diff options
| author | Paulo Alcantara <[email protected]> | 2025-09-08 00:24:06 +0000 |
|---|---|---|
| committer | Steve French <[email protected]> | 2025-09-09 23:39:58 +0000 |
| commit | c5ea3065586d790ea5193a679b85585173d59866 (patch) | |
| tree | 08cfd7803adf6d8f8346f05a5a67d98fdf428c8f /fs/btrfs/dev-replace.c | |
| parent | smb: client: fix compound alignment with encryption (diff) | |
| download | kernel-c5ea3065586d790ea5193a679b85585173d59866.tar.gz kernel-c5ea3065586d790ea5193a679b85585173d59866.zip | |
smb: client: fix data loss due to broken rename(2)
Rename of open files in SMB2+ has been broken for a very long time,
resulting in data loss as the CIFS client would fail the rename(2)
call with -ENOENT and then removing the target file.
Fix this by implementing ->rename_pending_delete() for SMB2+, which
will rename busy files to random filenames (e.g. silly rename) during
unlink(2) or rename(2), and then marking them to delete-on-close.
Besides, introduce a FIND_WR_NO_PENDING_DELETE flag to prevent open(2)
from reusing open handles that had been marked as delete pending.
Handle it in cifs_get_readable_path() as well.
Reported-by: Jean-Baptiste Denis <[email protected]>
Closes: https://marc.info/[email protected]
Reviewed-by: David Howells <[email protected]>
Cc: [email protected]
Signed-off-by: Paulo Alcantara (Red Hat) <[email protected]>
Cc: Frank Sorenson <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Benjamin Coddington <[email protected]>
Cc: Scott Mayhew <[email protected]>
Cc: [email protected]
Signed-off-by: Steve French <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions
