diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-06-17 22:48:28 +0200 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2016-06-24 18:01:00 +0200 |
commit | 916ec34d0bafe95b977908acd8b3153c9df6f9d6 (patch) | |
tree | 04c046d249b55cf11ee5cbc7f0108d67b9a606c9 | |
parent | NFS: Don't let readdirplus revalidate an inode that was marked as stale (diff) | |
download | linux-916ec34d0bafe95b977908acd8b3153c9df6f9d6.tar.xz linux-916ec34d0bafe95b977908acd8b3153c9df6f9d6.zip |
NFS: Fix potential race in nfs_fhget()
If we don't set the mode correctly in nfs_init_locked(), then there is
potential for a race with a second call to nfs_fhget that will cause
inode aliasing.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
-rw-r--r-- | fs/nfs/inode.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 52e7d6869e3b..dda689d7a8a7 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -282,6 +282,7 @@ nfs_init_locked(struct inode *inode, void *opaque) struct nfs_fattr *fattr = desc->fattr; set_nfs_fileid(inode, fattr->fileid); + inode->i_mode = fattr->mode; nfs_copy_fh(NFS_FH(inode), desc->fh); return 0; } |