mirror of https://gitee.com/openkylin/linux.git
ext4: clear BH_Uptodate flag on decryption error
If decryption fails, ext4_block_write_begin() can return with the page's buffer_head marked with the BH_Uptodate flag. This commit clears the BH_Uptodate flag in such cases. Signed-off-by: Chandan Rajendra <chandan@linux.ibm.com> Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
parent
ffceeefb33
commit
7e0785fce1
|
@ -1229,10 +1229,14 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len,
|
||||||
if (!buffer_uptodate(*wait_bh))
|
if (!buffer_uptodate(*wait_bh))
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
}
|
}
|
||||||
if (unlikely(err))
|
if (unlikely(err)) {
|
||||||
page_zero_new_buffers(page, from, to);
|
page_zero_new_buffers(page, from, to);
|
||||||
else if (decrypt)
|
} else if (decrypt) {
|
||||||
err = fscrypt_decrypt_pagecache_blocks(page, PAGE_SIZE, 0);
|
err = fscrypt_decrypt_pagecache_blocks(page, PAGE_SIZE, 0);
|
||||||
|
if (err)
|
||||||
|
clear_buffer_uptodate(*wait_bh);
|
||||||
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue