From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f175.google.com ([209.85.220.175]:33504 "EHLO mail-qk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164811AbdEYP7A (ORCPT ); Thu, 25 May 2017 11:59:00 -0400 Received: by mail-qk0-f175.google.com with SMTP id y201so180313690qka.0 for ; Thu, 25 May 2017 08:59:00 -0700 (PDT) Message-ID: <1495727937.2928.3.camel@redhat.com> Subject: Re: [PATCH 11/13] orangefs: lock inode during fsync From: Jeff Layton To: Martin Brandenburg , hubcap@omnibond.com, linux-fsdevel@vger.kernel.org Date: Thu, 25 May 2017 11:58:57 -0400 In-Reply-To: <1495447141-12216-12-git-send-email-martin@omnibond.com> References: <1495447141-12216-1-git-send-email-martin@omnibond.com> <1495447141-12216-12-git-send-email-martin@omnibond.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, 2017-05-22 at 05:58 -0400, Martin Brandenburg wrote: > Signed-off-by: Martin Brandenburg > --- > 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