Skip to content

Commit

Permalink
NFS: Remove unnecessary inode lock in nfs_fsync_dir()
Browse files Browse the repository at this point in the history
nfs_inc_stats() is already thread-safe, and there are no other reasons
to hold the inode lock here.

Signed-off-by: Trond Myklebust <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
  • Loading branch information
Trond Myklebust authored and amschuma-ntap committed Nov 12, 2020
1 parent 83f2c45 commit 11decaf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,13 +997,9 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence)
static int nfs_fsync_dir(struct file *filp, loff_t start, loff_t end,
int datasync)
{
struct inode *inode = file_inode(filp);

dfprintk(FILE, "NFS: fsync dir(%pD2) datasync %d\n", filp, datasync);

inode_lock(inode);
nfs_inc_stats(inode, NFSIOS_VFSFSYNC);
inode_unlock(inode);
nfs_inc_stats(file_inode(filp), NFSIOS_VFSFSYNC);
return 0;
}

Expand Down

0 comments on commit 11decaf

Please sign in to comment.