]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb: client: get rid of d_drop() in cifs_do_rename()
authorPaulo Alcantara <pc@manguebit.org>
Thu, 23 Oct 2025 00:11:01 +0000 (21:11 -0300)
committerSteve French <stfrench@microsoft.com>
Thu, 23 Oct 2025 07:46:50 +0000 (02:46 -0500)
There is no need to force a lookup by unhashing the moved dentry after
successfully renaming the file on server.  The file metadata will be
re-fetched from server, if necessary, in the next call to
->d_revalidate() anyways.

Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: stable@vger.kernel.org
Cc: linux-cifs@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/inode.c

index 098a79b7a9596c254f547e864acc7be23609293f..cac355364e43c4bc5e5304c4277bd8d8260c2034 100644 (file)
@@ -2484,11 +2484,8 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry,
        }
 #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */
 do_rename_exit:
-       if (rc == 0) {
+       if (rc == 0)
                d_move(from_dentry, to_dentry);
-               /* Force a new lookup */
-               d_drop(from_dentry);
-       }
        cifs_put_tlink(tlink);
        return rc;
 }