Skip to content

Commit 9f990d7

Browse files
committed
smb: client: fix double put of @CFILE in smb2_rename_path()
JIRA: https://issues.redhat.com/browse/RHEL-57983 commit 3523a3d Author: Paulo Alcantara <[email protected]> Date: Tue Sep 3 10:53:23 2024 -0300 smb: client: fix double put of @CFILE in smb2_rename_path() If smb2_set_path_attr() is called with a valid @CFILE and returned -EINVAL, we need to call cifs_get_writable_path() again as the reference of @CFILE was already dropped by previous smb2_compound_op() call. Fixes: 71f15c9 ("smb: client: retry compound request without reusing lease") Signed-off-by: Paulo Alcantara (Red Hat) <[email protected]> Cc: David Howells <[email protected]> Signed-off-by: Steve French <[email protected]> Signed-off-by: Paulo Alcantara <[email protected]>
1 parent 2c980b2 commit 9f990d7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/smb/client/smb2inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,8 @@ int smb2_rename_path(const unsigned int xid,
11061106
co, DELETE, SMB2_OP_RENAME, cfile, source_dentry);
11071107
if (rc == -EINVAL) {
11081108
cifs_dbg(FYI, "invalid lease key, resending request without lease");
1109+
cifs_get_writable_path(tcon, from_name,
1110+
FIND_WR_WITH_DELETE, &cfile);
11091111
rc = smb2_set_path_attr(xid, tcon, from_name, to_name, cifs_sb,
11101112
co, DELETE, SMB2_OP_RENAME, cfile, NULL);
11111113
}

0 commit comments

Comments
 (0)