Re: [PATCH 11/13] orangefs: lock inode during fsync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2017-05-22 at 05:58 -0400, Martin Brandenburg wrote:
> Signed-off-by: Martin Brandenburg <martin@xxxxxxxxxxxx>
> ---
>  fs/orangefs/file.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
> index cd126dd..f8536a7 100644
> --- a/fs/orangefs/file.c
> +++ b/fs/orangefs/file.c
> @@ -652,7 +652,9 @@ static int orangefs_fsync(struct file *file,
>  	struct orangefs_kernel_op_s *new_op = NULL;
>  
>  	/* required call */
> +	inode_lock(file_inode(file));
>  	filemap_write_and_wait_range(file->f_mapping, start, end);
> +	inode_unlock(file_inode(file));
>  
>  	new_op = op_alloc(ORANGEFS_VFS_OP_FSYNC);
>  	if (!new_op)

Why? You're just writing back the cached file data here. There's no
reason to lock the inode for that, AFAICS.

-- 
Jeff Layton <jlayton@xxxxxxxxxx>



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux