summaryrefslogtreecommitdiff
path: root/fs/jbd2/commit.c
diff options
context:
space:
mode:
authorBaokun Li <libaokun1@huawei.com>2025-01-22 19:05:26 +0800
committerTheodore Ts'o <tytso@mit.edu>2025-03-13 10:08:08 -0400
commite856f93e0fb249955f7d5efb18fe20500a9ccc6d (patch)
tree5e4f2dccf4f47a2108cfa5cb319a1288d6a3469b /fs/jbd2/commit.c
parent2f94b537c48db155f5aa68d63b747f9d82248341 (diff)
ext4: do not convert the unwritten extents if data writeback fails
When dioread_nolock is turned on (the default), it will convert unwritten extents to written at ext4_end_io_end(), even if the data writeback fails. It leads to the possibility that stale data may be exposed when the physical block corresponding to the file data is read-only (i.e., writes return -EIO, but reads are normal). Therefore a new ext4_io_end->flags EXT4_IO_END_FAILED is added, which indicates that some bio write-back failed in the current ext4_io_end. When this flag is set, the unwritten to written conversion is no longer performed. Users can read the data normally until the caches are dropped, after that, the failed extents can only be read to all 0. Signed-off-by: Baokun Li <libaokun1@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Link: https://patch.msgid.link/20250122110533.4116662-3-libaokun@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2/commit.c')
0 files changed, 0 insertions, 0 deletions