From f394a38d3e2beca988d1aec9fcf870d1a7466470 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 6 May 2011 20:41:48 +0300 Subject: [PATCH] --- yaml --- r: 250443 b: refs/heads/master c: 8ca5175b02b77178a70cbb9fd7020c4938e3d3a6 h: refs/heads/master i: 250441: 92cc047cbe0f9b1be0217dc109b0e48d763c2362 250439: f885bee393778398eb0815c281dbfee6db630b4b v: v3 --- [refs] | 2 +- trunk/fs/ubifs/lprops.c | 42 ++++++++++++++++++----------------------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/[refs] b/[refs] index 7b0fb259c4bb..4b55259cee48 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eaeee242c531cd4b0a4a46e8b5dd7ef504380c42 +refs/heads/master: 8ca5175b02b77178a70cbb9fd7020c4938e3d3a6 diff --git a/trunk/fs/ubifs/lprops.c b/trunk/fs/ubifs/lprops.c index 0ee0847f2421..ce9fe3933d16 100644 --- a/trunk/fs/ubifs/lprops.c +++ b/trunk/fs/ubifs/lprops.c @@ -1100,32 +1100,26 @@ static int scan_check_cb(struct ubifs_info *c, goto out; } + /* + * After an unclean unmount, empty and freeable LEBs + * may contain garbage - do not scan them. + */ + if (lp->free == c->leb_size) { + lst->empty_lebs += 1; + lst->total_free += c->leb_size; + lst->total_dark += ubifs_calc_dark(c, c->leb_size); + return LPT_SCAN_CONTINUE; + } + if (lp->free + lp->dirty == c->leb_size && + !(lp->flags & LPROPS_INDEX)) { + lst->total_free += lp->free; + lst->total_dirty += lp->dirty; + lst->total_dark += ubifs_calc_dark(c, c->leb_size); + return LPT_SCAN_CONTINUE; + } + sleb = ubifs_scan(c, lnum, 0, buf, 0); if (IS_ERR(sleb)) { - /* - * After an unclean unmount, empty and freeable LEBs - * may contain garbage. - */ - if (lp->free == c->leb_size) { - ubifs_err("scan errors were in empty LEB " - "- continuing checking"); - lst->empty_lebs += 1; - lst->total_free += c->leb_size; - lst->total_dark += ubifs_calc_dark(c, c->leb_size); - ret = LPT_SCAN_CONTINUE; - goto exit; - } - - if (lp->free + lp->dirty == c->leb_size && - !(lp->flags & LPROPS_INDEX)) { - ubifs_err("scan errors were in freeable LEB " - "- continuing checking"); - lst->total_free += lp->free; - lst->total_dirty += lp->dirty; - lst->total_dark += ubifs_calc_dark(c, c->leb_size); - ret = LPT_SCAN_CONTINUE; - goto exit; - } data->err = PTR_ERR(sleb); ret = LPT_SCAN_STOP; goto exit;