mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 06:12:08 +00:00
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>
This commit is contained in:
parent
d8fdb47fae
commit
916ec34d0b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user