Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250444
b: refs/heads/master
c: dcc50c8
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed May 16, 2011
1 parent f394a38 commit b3555f0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ca5175b02b77178a70cbb9fd7020c4938e3d3a6
refs/heads/master: dcc50c8ee334d570cef84fc956084d567f32a8a3
25 changes: 10 additions & 15 deletions trunk/fs/ubifs/lprops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ static int scan_check_cb(struct ubifs_info *c,
if (cat != (lp->flags & LPROPS_CAT_MASK)) {
ubifs_err("bad LEB category %d expected %d",
(lp->flags & LPROPS_CAT_MASK), cat);
goto out;
return -EINVAL;
}
}

Expand Down Expand Up @@ -1078,7 +1078,7 @@ static int scan_check_cb(struct ubifs_info *c,
}
if (!found) {
ubifs_err("bad LPT list (category %d)", cat);
goto out;
return -EINVAL;
}
}
}
Expand All @@ -1090,15 +1090,13 @@ static int scan_check_cb(struct ubifs_info *c,
if ((lp->hpos != -1 && heap->arr[lp->hpos]->lnum != lnum) ||
lp != heap->arr[lp->hpos]) {
ubifs_err("bad LPT heap (category %d)", cat);
goto out;
return -EINVAL;
}
}

buf = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL);
if (!buf) {
ubifs_err("cannot allocate memory to scan LEB %d", lnum);
goto out;
}
if (!buf)
return -ENOMEM;

/*
* After an unclean unmount, empty and freeable LEBs
Expand All @@ -1120,9 +1118,8 @@ static int scan_check_cb(struct ubifs_info *c,

sleb = ubifs_scan(c, lnum, 0, buf, 0);
if (IS_ERR(sleb)) {
data->err = PTR_ERR(sleb);
ret = LPT_SCAN_STOP;
goto exit;
ret = PTR_ERR(sleb);
goto out;
}

is_idx = -1;
Expand Down Expand Up @@ -1240,10 +1237,8 @@ static int scan_check_cb(struct ubifs_info *c,
}

ubifs_scan_destroy(sleb);
ret = LPT_SCAN_CONTINUE;
exit:
vfree(buf);
return ret;
return LPT_SCAN_CONTINUE;

out_print:
ubifs_err("bad accounting of LEB %d: free %d, dirty %d flags %#x, "
Expand All @@ -1252,10 +1247,10 @@ static int scan_check_cb(struct ubifs_info *c,
dbg_dump_leb(c, lnum);
out_destroy:
ubifs_scan_destroy(sleb);
ret = -EINVAL;
out:
vfree(buf);
data->err = -EINVAL;
return LPT_SCAN_STOP;
return ret;
}

/**
Expand Down

0 comments on commit b3555f0

Please sign in to comment.