Skip to content

Commit 42c2d31

Browse files
ashishsangwan2gregkh
authored andcommitted
NFS: fix nfs_path in case of a rename retry
commit 247db73 upstream. We are generating incorrect path in case of rename retry because we are restarting from wrong dentry. We should restart from the dentry which was received in the call to nfs_path. CC: stable@vger.kernel.org Signed-off-by: Ashish Sangwan <ashishsangwan2@gmail.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3b224e0 commit 42c2d31

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

fs/nfs/namespace.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ int nfs_mountpoint_expiry_timeout = 500 * HZ;
3232
/*
3333
* nfs_path - reconstruct the path given an arbitrary dentry
3434
* @base - used to return pointer to the end of devname part of path
35-
* @dentry - pointer to dentry
35+
* @dentry_in - pointer to dentry
3636
* @buffer - result buffer
37-
* @buflen - length of buffer
37+
* @buflen_in - length of buffer
3838
* @flags - options (see below)
3939
*
4040
* Helper function for constructing the server pathname
@@ -49,15 +49,19 @@ int nfs_mountpoint_expiry_timeout = 500 * HZ;
4949
* the original device (export) name
5050
* (if unset, the original name is returned verbatim)
5151
*/
52-
char *nfs_path(char **p, struct dentry *dentry, char *buffer, ssize_t buflen,
53-
unsigned flags)
52+
char *nfs_path(char **p, struct dentry *dentry_in, char *buffer,
53+
ssize_t buflen_in, unsigned flags)
5454
{
5555
char *end;
5656
int namelen;
5757
unsigned seq;
5858
const char *base;
59+
struct dentry *dentry;
60+
ssize_t buflen;
5961

6062
rename_retry:
63+
buflen = buflen_in;
64+
dentry = dentry_in;
6165
end = buffer+buflen;
6266
*--end = '\0';
6367
buflen--;

0 commit comments

Comments
 (0)