diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 20:27:40 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 20:27:40 +0400 |
commit | e57f146b2837d6a2d04a8ca86cb703f509b00e98 (patch) | |
tree | 0ebde713fc9bae7a0bcf626a5a66219899acd0b3 /fs/ubifs/sb.c | |
parent | 7e61b3ff50f59f134054aaf43096c761fafecf0c (diff) | |
parent | 5a1f36c90c9b21a7aa31c29a1926b376dd6a11cf (diff) | |
download | linux-e57f146b2837d6a2d04a8ca86cb703f509b00e98.tar.xz |
Merge tag 'upstream-3.4-rc1' of git://git.infradead.org/linux-ubifs
Pull UBIFS changes from Artem Bityutskiy:
- Improve error messages
- Clean-up i_nlink management
- Minor clean-ups
* tag 'upstream-3.4-rc1' of git://git.infradead.org/linux-ubifs:
UBIFS: improve error messages
UBIFS: kill CUR_MAX_KEY_LEN macro
UBIFS: do not use inc_link when i_nlink is zero
UBIFS: make the dbg_lock spinlock static
UBIFS: increase dumps loglevel
UBIFS: amend recovery debugging message
Diffstat (limited to 'fs/ubifs/sb.c')
-rw-r--r-- | fs/ubifs/sb.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 6094c5a5d7a8..771f7fb6ce92 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c @@ -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; } @@ -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; |