summaryrefslogtreecommitdiff
path: root/drivers/phy/eswin/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorHuiwen He <hehuiwen@kylinos.cn>2026-06-06 00:35:17 +0800
committerSteve French <stfrench@microsoft.com>2026-06-14 15:12:23 -0500
commitaf25ab681ea0cead031379c8dcb112678a2e1cf6 (patch)
tree8283d34323008d51eef2309884ef372235997ca3 /drivers/phy/eswin/git@git.tavy.me:linux.git
parente8a5cf2ff5a13fefb228f2069e29dd7d8e37185d (diff)
smb/client: update i_blocks after contiguous writes
When a lease allows CIFS to use cached inode attributes, getattr may return the locally cached attributes instead of revalidating them from the server. After local writes extend a file, the write path updates the file size, but i_blocks can remain based on the old allocation size. For example, while the file is still open after two contiguous writes, the local block count can remain smaller than the written range: after first write: st_size = 4096, st_blocks = 7 after second write: st_size = 12288, st_blocks = 21 after close: st_size = 12288, st_blocks = 24 This can make a fully written file look sparse: i_blocks * 512 < i_size and can cause swap activation to reject a valid write-created swapfile as having holes. This results in xfstests skipping swap-related tests on CIFS mounts: generic/472 [not run] swapfiles are not supported generic/494 [not run] swapfiles are not supported generic/497 [not run] swapfiles are not supported generic/569 [not run] swapfiles are not supported generic/636 [not run] swapfiles are not supported generic/643 [not run] swapfiles are not supported Update the local i_blocks estimate after successful writes, but only when the write starts at or before the currently known allocated range. This lets sequential writes grow i_blocks while avoiding treating write-past-EOF holes as allocated. Skip the local estimate for files that are already marked sparse, since their allocation needs to come from the server rather than from a contiguous-write estimate. Signed-off-by: Huiwen He <hehuiwen@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'drivers/phy/eswin/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions