diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-13 09:02:19 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-16 03:31:40 -0400 |
commit | 7703f09ded1b8719d2defe0f61215b4a08702ffa (patch) | |
tree | 4783cecf73b55e4a402e227fd5ef43a669806c44 /fs/ubifs | |
parent | e9ef7b5f25d31c5660fb4a87f4b40ac48070fcb7 (diff) |
UBIFS: double check that buds are replied in order
Commit 52c6e6f990669deac3f370f1603815adb55a1dbd provides misleading infomation
in the commit messages - buds are replied in order. And the real reason why
that fix helped is probably because it made sure we seek head even in read-only
mode (so deferred recovery will have seeked heads).
This patch adds an assertion which will fire if we reply buds out of order.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/replay.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index e27346f6c67c..5e815034aabd 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c | |||
@@ -713,6 +713,7 @@ static int replay_buds(struct ubifs_info *c) | |||
713 | { | 713 | { |
714 | struct bud_entry *b; | 714 | struct bud_entry *b; |
715 | int err, uninitialized_var(free), uninitialized_var(dirty); | 715 | int err, uninitialized_var(free), uninitialized_var(dirty); |
716 | unsigned long long prev_sqnum = 0; | ||
716 | 717 | ||
717 | list_for_each_entry(b, &c->replay_buds, list) { | 718 | list_for_each_entry(b, &c->replay_buds, list) { |
718 | err = replay_bud(c, b->bud->lnum, b->bud->start, b->bud->jhead, | 719 | err = replay_bud(c, b->bud->lnum, b->bud->start, b->bud->jhead, |
@@ -723,6 +724,9 @@ static int replay_buds(struct ubifs_info *c) | |||
723 | free, dirty, b->bud->jhead); | 724 | free, dirty, b->bud->jhead); |
724 | if (err) | 725 | if (err) |
725 | return err; | 726 | return err; |
727 | |||
728 | ubifs_assert(b->sqnum > prev_sqnum); | ||
729 | prev_sqnum = b->sqnum; | ||
726 | } | 730 | } |
727 | 731 | ||
728 | return 0; | 732 | return 0; |