Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294654
b: refs/heads/master
c: 5a1f36c
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy committed Mar 7, 2012
1 parent ae6dbab commit 5377cbf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 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: 7ca58bad6904c721678cf2171dc78b97cc03d500
refs/heads/master: 5a1f36c90c9b21a7aa31c29a1926b376dd6a11cf
19 changes: 14 additions & 5 deletions trunk/fs/ubifs/sb.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,23 @@ static int validate_sb(struct ubifs_info *c, struct ubifs_sb_node *sup)
}

if (c->main_lebs < UBIFS_MIN_MAIN_LEBS) {
err = 7;
ubifs_err("too few main LEBs count %d, must be at least %d",
c->main_lebs, UBIFS_MIN_MAIN_LEBS);
goto failed;
}

if (c->max_bud_bytes < (long long)c->leb_size * UBIFS_MIN_BUD_LEBS ||
c->max_bud_bytes > (long long)c->leb_size * c->main_lebs) {
err = 8;
max_bytes = (long long)c->leb_size * UBIFS_MIN_BUD_LEBS;
if (c->max_bud_bytes < max_bytes) {
ubifs_err("too small journal (%lld bytes), must be at least "
"%lld bytes", c->max_bud_bytes, max_bytes);
goto failed;
}

max_bytes = (long long)c->leb_size * c->main_lebs;
if (c->max_bud_bytes > max_bytes) {
ubifs_err("too large journal size (%lld bytes), only %lld bytes"
"available in the main area",
c->max_bud_bytes, max_bytes);
goto failed;
}

Expand Down Expand Up @@ -450,7 +460,6 @@ static int validate_sb(struct ubifs_info *c, struct ubifs_sb_node *sup)
goto failed;
}

max_bytes = c->main_lebs * (long long)c->leb_size;
if (c->rp_size < 0 || max_bytes < c->rp_size) {
err = 14;
goto failed;
Expand Down

0 comments on commit 5377cbf

Please sign in to comment.