aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/lprops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/lprops.c')
-rw-r--r--fs/ubifs/lprops.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c
index 0ee0847f2421..ce9fe3933d16 100644
--- a/fs/ubifs/lprops.c
+++ b/fs/ubifs/lprops.c
@@ -1100,32 +1100,26 @@ static int scan_check_cb(struct ubifs_info *c,
1100 goto out; 1100 goto out;
1101 } 1101 }
1102 1102
1103 /*
1104 * After an unclean unmount, empty and freeable LEBs
1105 * may contain garbage - do not scan them.
1106 */
1107 if (lp->free == c->leb_size) {
1108 lst->empty_lebs += 1;
1109 lst->total_free += c->leb_size;
1110 lst->total_dark += ubifs_calc_dark(c, c->leb_size);
1111 return LPT_SCAN_CONTINUE;
1112 }
1113 if (lp->free + lp->dirty == c->leb_size &&
1114 !(lp->flags & LPROPS_INDEX)) {
1115 lst->total_free += lp->free;
1116 lst->total_dirty += lp->dirty;
1117 lst->total_dark += ubifs_calc_dark(c, c->leb_size);
1118 return LPT_SCAN_CONTINUE;
1119 }
1120
1103 sleb = ubifs_scan(c, lnum, 0, buf, 0); 1121 sleb = ubifs_scan(c, lnum, 0, buf, 0);
1104 if (IS_ERR(sleb)) { 1122 if (IS_ERR(sleb)) {
1105 /*
1106 * After an unclean unmount, empty and freeable LEBs
1107 * may contain garbage.
1108 */
1109 if (lp->free == c->leb_size) {
1110 ubifs_err("scan errors were in empty LEB "
1111 "- continuing checking");
1112 lst->empty_lebs += 1;
1113 lst->total_free += c->leb_size;
1114 lst->total_dark += ubifs_calc_dark(c, c->leb_size);
1115 ret = LPT_SCAN_CONTINUE;
1116 goto exit;
1117 }
1118
1119 if (lp->free + lp->dirty == c->leb_size &&
1120 !(lp->flags & LPROPS_INDEX)) {
1121 ubifs_err("scan errors were in freeable LEB "
1122 "- continuing checking");
1123 lst->total_free += lp->free;
1124 lst->total_dirty += lp->dirty;
1125 lst->total_dark += ubifs_calc_dark(c, c->leb_size);
1126 ret = LPT_SCAN_CONTINUE;
1127 goto exit;
1128 }
1129 data->err = PTR_ERR(sleb); 1123 data->err = PTR_ERR(sleb);
1130 ret = LPT_SCAN_STOP; 1124 ret = LPT_SCAN_STOP;
1131 goto exit; 1125 goto exit;