]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:10:22 +0000 (14:10 +0100)
commit 72ed55b4c335703c203b942972558173e1e5ddee upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/inode.c

index 6b41360631f96ec9bac3c61e95fd5b97d008f4c1..bf82a6fd7bf8bbec79094b09c459c31064b65181 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;
 }