aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/scan.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 16:43:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 16:43:40 -0400
commitd613896926be608796bb80454256a07b55fe0e87 (patch)
treee741ea9477e013a319d3dedceb0aea66c8c3606d /fs/ubifs/scan.c
parentfa927894bbb4a4c7669c72bad1924991022fda38 (diff)
parent502690674281a047abd45f81e64c498bc23a8bb3 (diff)
Merge tag 'upstream-4.1-rc1' of git://git.infradead.org/linux-ubifs
Pull UBI/UBIFS updates from Richard Weinberger: "This pull request includes the following UBI/UBIFS changes: - powercut emulation for UBI - a huge update to UBI Fastmap - cleanups and bugfixes all over UBI and UBIFS" * tag 'upstream-4.1-rc1' of git://git.infradead.org/linux-ubifs: (50 commits) UBI: power cut emulation for testing UBIFS: fix output format of INUM_WATERMARK UBI: Fastmap: Fall back to scanning mode after ECC error UBI: Fastmap: Remove is_fm_block() UBI: Fastmap: Add blank line after declarations UBI: Fastmap: Remove else after return. UBI: Fastmap: Introduce may_reserve_for_fm() UBI: Fastmap: Introduce ubi_fastmap_init() UBI: Fastmap: Wire up WL accessor functions UBI: Add accessor functions for WL data structures UBI: Move fastmap specific functions out of wl.c UBI: Fastmap: Add new module parameter fm_debug UBI: Fastmap: Make self_check_eba() depend on fastmap self checking UBI: Fastmap: Add self check to detect absent PEBs UBI: Fix stale pointers in ubi->lookuptbl UBI: Fastmap: Enhance fastmap checking UBI: Add initial support for fastmap self checks UBI: Fastmap: Rework fastmap error paths UBI: Fastmap: Prepare for variable sized fastmaps UBI: Fastmap: Locking updates ...
Diffstat (limited to 'fs/ubifs/scan.c')
-rw-r--r--fs/ubifs/scan.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c
index 89adbc4d08ac..aab87340d3de 100644
--- a/fs/ubifs/scan.c
+++ b/fs/ubifs/scan.c
@@ -100,7 +100,7 @@ int ubifs_scan_a_node(const struct ubifs_info *c, void *buf, int len, int lnum,
100 if (pad_len < 0 || 100 if (pad_len < 0 ||
101 offs + node_len + pad_len > c->leb_size) { 101 offs + node_len + pad_len > c->leb_size) {
102 if (!quiet) { 102 if (!quiet) {
103 ubifs_err("bad pad node at LEB %d:%d", 103 ubifs_err(c, "bad pad node at LEB %d:%d",
104 lnum, offs); 104 lnum, offs);
105 ubifs_dump_node(c, pad); 105 ubifs_dump_node(c, pad);
106 } 106 }
@@ -110,7 +110,7 @@ int ubifs_scan_a_node(const struct ubifs_info *c, void *buf, int len, int lnum,
110 /* Make the node pads to 8-byte boundary */ 110 /* Make the node pads to 8-byte boundary */
111 if ((node_len + pad_len) & 7) { 111 if ((node_len + pad_len) & 7) {
112 if (!quiet) 112 if (!quiet)
113 ubifs_err("bad padding length %d - %d", 113 ubifs_err(c, "bad padding length %d - %d",
114 offs, offs + node_len + pad_len); 114 offs, offs + node_len + pad_len);
115 return SCANNED_A_BAD_PAD_NODE; 115 return SCANNED_A_BAD_PAD_NODE;
116 } 116 }
@@ -152,7 +152,7 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum,
152 152
153 err = ubifs_leb_read(c, lnum, sbuf + offs, offs, c->leb_size - offs, 0); 153 err = ubifs_leb_read(c, lnum, sbuf + offs, offs, c->leb_size - offs, 0);
154 if (err && err != -EBADMSG) { 154 if (err && err != -EBADMSG) {
155 ubifs_err("cannot read %d bytes from LEB %d:%d, error %d", 155 ubifs_err(c, "cannot read %d bytes from LEB %d:%d, error %d",
156 c->leb_size - offs, lnum, offs, err); 156 c->leb_size - offs, lnum, offs, err);
157 kfree(sleb); 157 kfree(sleb);
158 return ERR_PTR(err); 158 return ERR_PTR(err);
@@ -240,11 +240,11 @@ void ubifs_scanned_corruption(const struct ubifs_info *c, int lnum, int offs,
240{ 240{
241 int len; 241 int len;
242 242
243 ubifs_err("corruption at LEB %d:%d", lnum, offs); 243 ubifs_err(c, "corruption at LEB %d:%d", lnum, offs);
244 len = c->leb_size - offs; 244 len = c->leb_size - offs;
245 if (len > 8192) 245 if (len > 8192)
246 len = 8192; 246 len = 8192;
247 ubifs_err("first %d bytes from LEB %d:%d", len, lnum, offs); 247 ubifs_err(c, "first %d bytes from LEB %d:%d", len, lnum, offs);
248 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 4, buf, len, 1); 248 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 4, buf, len, 1);
249} 249}
250 250
@@ -299,16 +299,16 @@ struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum,
299 299
300 switch (ret) { 300 switch (ret) {
301 case SCANNED_GARBAGE: 301 case SCANNED_GARBAGE:
302 ubifs_err("garbage"); 302 ubifs_err(c, "garbage");
303 goto corrupted; 303 goto corrupted;
304 case SCANNED_A_NODE: 304 case SCANNED_A_NODE:
305 break; 305 break;
306 case SCANNED_A_CORRUPT_NODE: 306 case SCANNED_A_CORRUPT_NODE:
307 case SCANNED_A_BAD_PAD_NODE: 307 case SCANNED_A_BAD_PAD_NODE:
308 ubifs_err("bad node"); 308 ubifs_err(c, "bad node");
309 goto corrupted; 309 goto corrupted;
310 default: 310 default:
311 ubifs_err("unknown"); 311 ubifs_err(c, "unknown");
312 err = -EINVAL; 312 err = -EINVAL;
313 goto error; 313 goto error;
314 } 314 }
@@ -325,7 +325,7 @@ struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum,
325 325
326 if (offs % c->min_io_size) { 326 if (offs % c->min_io_size) {
327 if (!quiet) 327 if (!quiet)
328 ubifs_err("empty space starts at non-aligned offset %d", 328 ubifs_err(c, "empty space starts at non-aligned offset %d",
329 offs); 329 offs);
330 goto corrupted; 330 goto corrupted;
331 } 331 }
@@ -338,7 +338,7 @@ struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum,
338 for (; len; offs++, buf++, len--) 338 for (; len; offs++, buf++, len--)
339 if (*(uint8_t *)buf != 0xff) { 339 if (*(uint8_t *)buf != 0xff) {
340 if (!quiet) 340 if (!quiet)
341 ubifs_err("corrupt empty space at LEB %d:%d", 341 ubifs_err(c, "corrupt empty space at LEB %d:%d",
342 lnum, offs); 342 lnum, offs);
343 goto corrupted; 343 goto corrupted;
344 } 344 }
@@ -348,14 +348,14 @@ struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum,
348corrupted: 348corrupted:
349 if (!quiet) { 349 if (!quiet) {
350 ubifs_scanned_corruption(c, lnum, offs, buf); 350 ubifs_scanned_corruption(c, lnum, offs, buf);
351 ubifs_err("LEB %d scanning failed", lnum); 351 ubifs_err(c, "LEB %d scanning failed", lnum);
352 } 352 }
353 err = -EUCLEAN; 353 err = -EUCLEAN;
354 ubifs_scan_destroy(sleb); 354 ubifs_scan_destroy(sleb);
355 return ERR_PTR(err); 355 return ERR_PTR(err);
356 356
357error: 357error:
358 ubifs_err("LEB %d scanning failed, error %d", lnum, err); 358 ubifs_err(c, "LEB %d scanning failed, error %d", lnum, err);
359 ubifs_scan_destroy(sleb); 359 ubifs_scan_destroy(sleb);
360 return ERR_PTR(err); 360 return ERR_PTR(err);
361} 361}