diff options
author | Paulo Alcantara <pc@manguebit.org> | 2025-10-07 16:23:25 -0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2025-10-09 10:42:14 -0500 |
commit | dba9f997c9d9a1cade05d006ed0429a63a4eed32 (patch) | |
tree | 86d8f892d8cf78fd74cf262bf9dddcda6fe6280b /rust/kernel | |
parent | b95cd1bdf5aa9221c98fc9259014b8bb8d1829d7 (diff) |
smb: client: fix race with fallocate(2) and AIO+DIO
AIO+DIO may extend the file size, hence we need to make sure ->i_size
is stable across the entire fallocate(2) operation, otherwise it would
become a truncate and then inode size reduced back down when it
finishes.
Fix this by calling netfs_wait_for_outstanding_io() right after
acquiring ->i_rwsem exclusively in cifs_fallocate() and then guarantee
a stable ->i_size across fallocate(2).
Also call netfs_wait_for_outstanding_io() after truncating pagecache
to avoid any potential races with writeback.
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Fixes: 210627b0aca9 ("smb: client: fix missing timestamp updates with O_TRUNC")
Cc: Frank Sorenson <sorenson@redhat.com>
Cc: linux-cifs@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'rust/kernel')
0 files changed, 0 insertions, 0 deletions