From: Zhang Xiaoxu zhangxiaoxu5@huawei.com
hulk inclusion category: bugfix bugzilla: 34540 CVE: NA
---------------------------
Before journal checkpoint complete, the latest block bitmap stored in journal area and memory, the metadata area was old.
If io error occured when checkpoint, the uptodate was clear from buffer, then read old block bitmap from metadata area may lead bitmap corrpution.
This is only an temporary solution ,if the buffer reclaim by system, this patch also can't fix the problem. Mainline solution on discussion, we need to merge this patch to reduce the probability.
Signed-off-by: Zhang Xiaoxu zhangxiaoxu5@huawei.com Reviewed-by: zhangyi (F) yi.zhang@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- fs/ext4/balloc.c | 2 +- fs/ext4/ialloc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index f9645de9d04c..04c445ff638c 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -473,7 +473,7 @@ ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group) goto verify; } ext4_unlock_group(sb, block_group); - if (buffer_uptodate(bh)) { + if (ext4_buffer_uptodate(bh)) { /* * if not uninit if bh is uptodate, * bitmap is also uptodate diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 42e8f1dcfdf6..baab3a74183a 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -175,7 +175,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) } ext4_unlock_group(sb, block_group);
- if (buffer_uptodate(bh)) { + if (ext4_buffer_uptodate(bh)) { /* * if not uninit if bh is uptodate, * bitmap is also uptodate