Skip to content

Commit

Permalink
smb: client: fix double put of @CFILE in smb2_rename_path()
Browse files Browse the repository at this point in the history
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) <pc@manguebit.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
pcacjr authored and Steve French committed Sep 3, 2024
1 parent 7ccc146 commit 3523a3d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/smb/client/smb2inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,8 @@ int smb2_rename_path(const unsigned int xid,
co, DELETE, SMB2_OP_RENAME, cfile, source_dentry);
if (rc == -EINVAL) {
cifs_dbg(FYI, "invalid lease key, resending request without lease");
cifs_get_writable_path(tcon, from_name,
FIND_WR_WITH_DELETE, &cfile);
rc = smb2_set_path_attr(xid, tcon, from_name, to_name, cifs_sb,
co, DELETE, SMB2_OP_RENAME, cfile, NULL);
}
Expand Down

0 comments on commit 3523a3d

Please sign in to comment.