aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/recovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/recovery.c')
-rw-r--r--fs/ubifs/recovery.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c
index 13ca4dbc4d19..695fc71d5244 100644
--- a/fs/ubifs/recovery.c
+++ b/fs/ubifs/recovery.c
@@ -305,7 +305,7 @@ int ubifs_recover_master_node(struct ubifs_info *c)
305 mst = mst2; 305 mst = mst2;
306 } 306 }
307 307
308 ubifs_msg("recovered master node from LEB %d", 308 ubifs_msg(c, "recovered master node from LEB %d",
309 (mst == mst1 ? UBIFS_MST_LNUM : UBIFS_MST_LNUM + 1)); 309 (mst == mst1 ? UBIFS_MST_LNUM : UBIFS_MST_LNUM + 1));
310 310
311 memcpy(c->mst_node, mst, UBIFS_MST_NODE_SZ); 311 memcpy(c->mst_node, mst, UBIFS_MST_NODE_SZ);
@@ -360,13 +360,13 @@ int ubifs_recover_master_node(struct ubifs_info *c)
360out_err: 360out_err:
361 err = -EINVAL; 361 err = -EINVAL;
362out_free: 362out_free:
363 ubifs_err("failed to recover master node"); 363 ubifs_err(c, "failed to recover master node");
364 if (mst1) { 364 if (mst1) {
365 ubifs_err("dumping first master node"); 365 ubifs_err(c, "dumping first master node");
366 ubifs_dump_node(c, mst1); 366 ubifs_dump_node(c, mst1);
367 } 367 }
368 if (mst2) { 368 if (mst2) {
369 ubifs_err("dumping second master node"); 369 ubifs_err(c, "dumping second master node");
370 ubifs_dump_node(c, mst2); 370 ubifs_dump_node(c, mst2);
371 } 371 }
372 vfree(buf2); 372 vfree(buf2);
@@ -682,7 +682,7 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
682 ret, lnum, offs); 682 ret, lnum, offs);
683 break; 683 break;
684 } else { 684 } else {
685 ubifs_err("unexpected return value %d", ret); 685 ubifs_err(c, "unexpected return value %d", ret);
686 err = -EINVAL; 686 err = -EINVAL;
687 goto error; 687 goto error;
688 } 688 }
@@ -702,7 +702,7 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
702 * See header comment for this file for more 702 * See header comment for this file for more
703 * explanations about the reasons we have this check. 703 * explanations about the reasons we have this check.
704 */ 704 */
705 ubifs_err("corrupt empty space LEB %d:%d, corruption starts at %d", 705 ubifs_err(c, "corrupt empty space LEB %d:%d, corruption starts at %d",
706 lnum, offs, corruption); 706 lnum, offs, corruption);
707 /* Make sure we dump interesting non-0xFF data */ 707 /* Make sure we dump interesting non-0xFF data */
708 offs += corruption; 708 offs += corruption;
@@ -788,13 +788,13 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
788 788
789corrupted_rescan: 789corrupted_rescan:
790 /* Re-scan the corrupted data with verbose messages */ 790 /* Re-scan the corrupted data with verbose messages */
791 ubifs_err("corruption %d", ret); 791 ubifs_err(c, "corruption %d", ret);
792 ubifs_scan_a_node(c, buf, len, lnum, offs, 1); 792 ubifs_scan_a_node(c, buf, len, lnum, offs, 1);
793corrupted: 793corrupted:
794 ubifs_scanned_corruption(c, lnum, offs, buf); 794 ubifs_scanned_corruption(c, lnum, offs, buf);
795 err = -EUCLEAN; 795 err = -EUCLEAN;
796error: 796error:
797 ubifs_err("LEB %d scanning failed", lnum); 797 ubifs_err(c, "LEB %d scanning failed", lnum);
798 ubifs_scan_destroy(sleb); 798 ubifs_scan_destroy(sleb);
799 return ERR_PTR(err); 799 return ERR_PTR(err);
800} 800}
@@ -826,15 +826,15 @@ static int get_cs_sqnum(struct ubifs_info *c, int lnum, int offs,
826 goto out_free; 826 goto out_free;
827 ret = ubifs_scan_a_node(c, cs_node, UBIFS_CS_NODE_SZ, lnum, offs, 0); 827 ret = ubifs_scan_a_node(c, cs_node, UBIFS_CS_NODE_SZ, lnum, offs, 0);
828 if (ret != SCANNED_A_NODE) { 828 if (ret != SCANNED_A_NODE) {
829 ubifs_err("Not a valid node"); 829 ubifs_err(c, "Not a valid node");
830 goto out_err; 830 goto out_err;
831 } 831 }
832 if (cs_node->ch.node_type != UBIFS_CS_NODE) { 832 if (cs_node->ch.node_type != UBIFS_CS_NODE) {
833 ubifs_err("Node a CS node, type is %d", cs_node->ch.node_type); 833 ubifs_err(c, "Node a CS node, type is %d", cs_node->ch.node_type);
834 goto out_err; 834 goto out_err;
835 } 835 }
836 if (le64_to_cpu(cs_node->cmt_no) != c->cmt_no) { 836 if (le64_to_cpu(cs_node->cmt_no) != c->cmt_no) {
837 ubifs_err("CS node cmt_no %llu != current cmt_no %llu", 837 ubifs_err(c, "CS node cmt_no %llu != current cmt_no %llu",
838 (unsigned long long)le64_to_cpu(cs_node->cmt_no), 838 (unsigned long long)le64_to_cpu(cs_node->cmt_no),
839 c->cmt_no); 839 c->cmt_no);
840 goto out_err; 840 goto out_err;
@@ -847,7 +847,7 @@ static int get_cs_sqnum(struct ubifs_info *c, int lnum, int offs,
847out_err: 847out_err:
848 err = -EINVAL; 848 err = -EINVAL;
849out_free: 849out_free:
850 ubifs_err("failed to get CS sqnum"); 850 ubifs_err(c, "failed to get CS sqnum");
851 kfree(cs_node); 851 kfree(cs_node);
852 return err; 852 return err;
853} 853}
@@ -899,7 +899,7 @@ struct ubifs_scan_leb *ubifs_recover_log_leb(struct ubifs_info *c, int lnum,
899 } 899 }
900 } 900 }
901 if (snod->sqnum > cs_sqnum) { 901 if (snod->sqnum > cs_sqnum) {
902 ubifs_err("unrecoverable log corruption in LEB %d", 902 ubifs_err(c, "unrecoverable log corruption in LEB %d",
903 lnum); 903 lnum);
904 ubifs_scan_destroy(sleb); 904 ubifs_scan_destroy(sleb);
905 return ERR_PTR(-EUCLEAN); 905 return ERR_PTR(-EUCLEAN);
@@ -1037,7 +1037,7 @@ static int clean_an_unclean_leb(struct ubifs_info *c,
1037 } 1037 }
1038 1038
1039 if (ret == SCANNED_EMPTY_SPACE) { 1039 if (ret == SCANNED_EMPTY_SPACE) {
1040 ubifs_err("unexpected empty space at %d:%d", 1040 ubifs_err(c, "unexpected empty space at %d:%d",
1041 lnum, offs); 1041 lnum, offs);
1042 return -EUCLEAN; 1042 return -EUCLEAN;
1043 } 1043 }
@@ -1131,7 +1131,7 @@ static int grab_empty_leb(struct ubifs_info *c)
1131 */ 1131 */
1132 lnum = ubifs_find_free_leb_for_idx(c); 1132 lnum = ubifs_find_free_leb_for_idx(c);
1133 if (lnum < 0) { 1133 if (lnum < 0) {
1134 ubifs_err("could not find an empty LEB"); 1134 ubifs_err(c, "could not find an empty LEB");
1135 ubifs_dump_lprops(c); 1135 ubifs_dump_lprops(c);
1136 ubifs_dump_budg(c, &c->bi); 1136 ubifs_dump_budg(c, &c->bi);
1137 return lnum; 1137 return lnum;
@@ -1211,7 +1211,7 @@ int ubifs_rcvry_gc_commit(struct ubifs_info *c)
1211 } 1211 }
1212 mutex_unlock(&wbuf->io_mutex); 1212 mutex_unlock(&wbuf->io_mutex);
1213 if (err < 0) { 1213 if (err < 0) {
1214 ubifs_err("GC failed, error %d", err); 1214 ubifs_err(c, "GC failed, error %d", err);
1215 if (err == -EAGAIN) 1215 if (err == -EAGAIN)
1216 err = -EINVAL; 1216 err = -EINVAL;
1217 return err; 1217 return err;
@@ -1458,7 +1458,7 @@ static int fix_size_in_place(struct ubifs_info *c, struct size_entry *e)
1458 return 0; 1458 return 0;
1459 1459
1460out: 1460out:
1461 ubifs_warn("inode %lu failed to fix size %lld -> %lld error %d", 1461 ubifs_warn(c, "inode %lu failed to fix size %lld -> %lld error %d",
1462 (unsigned long)e->inum, e->i_size, e->d_size, err); 1462 (unsigned long)e->inum, e->i_size, e->d_size, err);
1463 return err; 1463 return err;
1464} 1464}