Skip to content

Commit

Permalink
NFS/pnfs: Fix dereference of layout cred in pnfs_layoutcommit_inode()
Browse files Browse the repository at this point in the history
Ensure that the dereference of the layout cred is atomic with the
stateid.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
Trond Myklebust committed Apr 3, 2020
1 parent fc51b1c commit 97a728f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3137,10 +3137,10 @@ pnfs_layoutcommit_inode(struct inode *inode, bool sync)
end_pos = nfsi->layout->plh_lwb;

nfs4_stateid_copy(&data->args.stateid, &nfsi->layout->plh_stateid);
data->cred = get_cred(nfsi->layout->plh_lc_cred);
spin_unlock(&inode->i_lock);

data->args.inode = inode;
data->cred = get_cred(nfsi->layout->plh_lc_cred);
nfs_fattr_init(&data->fattr);
data->args.bitmask = NFS_SERVER(inode)->cache_consistency_bitmask;
data->res.fattr = &data->fattr;
Expand Down

0 comments on commit 97a728f

Please sign in to comment.