aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/commit.c
diff options
context:
space:
mode:
authorSheng Yong <shengyong1@huawei.com>2015-03-20 06:39:42 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2015-03-25 05:08:41 -0400
commit235c362bd0f6afcf767bc72aa0c647e1434cc631 (patch)
tree1cbc858f95877e51ddf48ea00dec0f6f7a481469 /fs/ubifs/commit.c
parent8a87dc55f75f19ffdbb52066afea1b633577c79f (diff)
UBIFS: extend debug/message capabilities
In the case where we have more than one volumes on different UBI devices, it may be not that easy to tell which volume prints the messages. Add ubi number and volume id in ubifs_msg/warn/error to help debug. These two values are passed by struct ubifs_info. For those where ubifs_info is not initialized yet, ubifs_* is replaced by pr_*. For those where ubifs_info is not avaliable, ubifs_info is passed to the calling function as a const parameter. The output looks like, [ 95.444879] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 696 [ 95.484688] UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "test1" [ 95.484694] UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes [ 95.484699] UBIFS (ubi0:1): FS size: 30220288 bytes (28 MiB, 238 LEBs), journal size 1523712 bytes (1 MiB, 12 LEBs) [ 95.484703] UBIFS (ubi0:1): reserved for root: 1427378 bytes (1393 KiB) [ 95.484709] UBIFS (ubi0:1): media format: w4/r0 (latest is w4/r0), UUID 40DFFC0E-70BE-4193-8905-F7D6DFE60B17, small LPT model [ 95.489875] UBIFS (ubi1:0): background thread "ubifs_bgt1_0" started, PID 699 [ 95.529713] UBIFS (ubi1:0): UBIFS: mounted UBI device 1, volume 0, name "test2" [ 95.529718] UBIFS (ubi1:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes [ 95.529724] UBIFS (ubi1:0): FS size: 19808256 bytes (18 MiB, 156 LEBs), journal size 1015809 bytes (0 MiB, 8 LEBs) [ 95.529727] UBIFS (ubi1:0): reserved for root: 935592 bytes (913 KiB) [ 95.529733] UBIFS (ubi1:0): media format: w4/r0 (latest is w4/r0), UUID EEB7779D-F419-4CA9-811B-831CAC7233D4, small LPT model [ 954.264767] UBIFS error (ubi1:0 pid 756): ubifs_read_node: bad node type (255 but expected 6) [ 954.367030] UBIFS error (ubi1:0 pid 756): ubifs_read_node: bad node at LEB 0:0, LEB mapping status 1 Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'fs/ubifs/commit.c')
-rw-r--r--fs/ubifs/commit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/ubifs/commit.c b/fs/ubifs/commit.c
index 26b69b2d4a45..63f56619991d 100644
--- a/fs/ubifs/commit.c
+++ b/fs/ubifs/commit.c
@@ -225,7 +225,7 @@ out_cancel:
225out_up: 225out_up:
226 up_write(&c->commit_sem); 226 up_write(&c->commit_sem);
227out: 227out:
228 ubifs_err("commit failed, error %d", err); 228 ubifs_err(c, "commit failed, error %d", err);
229 spin_lock(&c->cs_lock); 229 spin_lock(&c->cs_lock);
230 c->cmt_state = COMMIT_BROKEN; 230 c->cmt_state = COMMIT_BROKEN;
231 wake_up(&c->cmt_wq); 231 wake_up(&c->cmt_wq);
@@ -289,7 +289,7 @@ int ubifs_bg_thread(void *info)
289 int err; 289 int err;
290 struct ubifs_info *c = info; 290 struct ubifs_info *c = info;
291 291
292 ubifs_msg("background thread \"%s\" started, PID %d", 292 ubifs_msg(c, "background thread \"%s\" started, PID %d",
293 c->bgt_name, current->pid); 293 c->bgt_name, current->pid);
294 set_freezable(); 294 set_freezable();
295 295
@@ -324,7 +324,7 @@ int ubifs_bg_thread(void *info)
324 cond_resched(); 324 cond_resched();
325 } 325 }
326 326
327 ubifs_msg("background thread \"%s\" stops", c->bgt_name); 327 ubifs_msg(c, "background thread \"%s\" stops", c->bgt_name);
328 return 0; 328 return 0;
329} 329}
330 330
@@ -712,13 +712,13 @@ out:
712 return 0; 712 return 0;
713 713
714out_dump: 714out_dump:
715 ubifs_err("dumping index node (iip=%d)", i->iip); 715 ubifs_err(c, "dumping index node (iip=%d)", i->iip);
716 ubifs_dump_node(c, idx); 716 ubifs_dump_node(c, idx);
717 list_del(&i->list); 717 list_del(&i->list);
718 kfree(i); 718 kfree(i);
719 if (!list_empty(&list)) { 719 if (!list_empty(&list)) {
720 i = list_entry(list.prev, struct idx_node, list); 720 i = list_entry(list.prev, struct idx_node, list);
721 ubifs_err("dumping parent index node"); 721 ubifs_err(c, "dumping parent index node");
722 ubifs_dump_node(c, &i->idx); 722 ubifs_dump_node(c, &i->idx);
723 } 723 }
724out_free: 724out_free:
@@ -727,7 +727,7 @@ out_free:
727 list_del(&i->list); 727 list_del(&i->list);
728 kfree(i); 728 kfree(i);
729 } 729 }
730 ubifs_err("failed, error %d", err); 730 ubifs_err(c, "failed, error %d", err);
731 if (err > 0) 731 if (err > 0)
732 err = -EINVAL; 732 err = -EINVAL;
733 return err; 733 return err;