diff options
| author | Zhang Yi <yi.zhang@huawei.com> | 2026-03-27 18:29:39 +0800 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2026-04-09 21:57:52 -0400 |
| commit | 3f60efd65412dfe4ff33b376a983220ef74056b1 (patch) | |
| tree | 67ceaa2d49a5deb6189ddaf5e1e5ce498fffb99b /rust/kernel/alloc | |
| parent | 1ad0f42823291bcac371dafd37533f5e8d92acc3 (diff) | |
ext4: zero post-EOF partial block before appending write
In cases of appending write beyond EOF, ext4_zero_partial_blocks() is
called within ext4_*_write_end() to zero out the partial block beyond
EOF. This prevents exposing stale data that might be written through
mmap.
However, supporting only the regular buffered write path is
insufficient. It is also necessary to support the DAX path as well as
the upcoming iomap buffered write path. Therefore, move this operation
to ext4_write_checks().
In addition, this may introduce a race window in which a post-EOF
buffered write can race with an mmap write after the old EOF block has
been zeroed. As a result, the data in this block written by the
buffer-write and the data written by the mmap-write may be mixed.
However, this is safe because users should not rely on the result of the
race condition.
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260327102939.1095257-14-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions
