Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752203AbdCDAwh (ORCPT ); Fri, 3 Mar 2017 19:52:37 -0500 Received: from mail-qk0-f173.google.com ([209.85.220.173]:34326 "EHLO mail-qk0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083AbdCDAwg (ORCPT ); Fri, 3 Mar 2017 19:52:36 -0500 Message-ID: <1488588201.11672.4.camel@redhat.com> Subject: Re: [RFC PATCH v1 29/30] fs: track whether the i_version has been queried with an i_state flag From: Jeff Layton To: NeilBrown , linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org Date: Fri, 03 Mar 2017 19:43:21 -0500 In-Reply-To: <87wpc5lxg6.fsf@notabene.neil.brown.name> References: <1482339827-7882-1-git-send-email-jlayton@redhat.com> <1482339827-7882-30-git-send-email-jlayton@redhat.com> <87wpc5lxg6.fsf@notabene.neil.brown.name> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.5 (3.22.5-1.fc25) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 796 Lines: 28 On Sat, 2017-03-04 at 11:03 +1100, NeilBrown wrote: > On Wed, Dec 21 2016, Jeff Layton wrote: > > > @@ -2072,7 +2093,12 @@ inode_cmp_iversion(const struct inode *inode, const u64 old) > > static inline bool > > inode_iversion_need_inc(struct inode *inode) > > { > > - return true; > > + bool ret; > > + > > + spin_lock(&inode->i_lock); > > + ret = inode->i_state & I_VERS_BUMP; > > + spin_unlock(&inode->i_lock); > > + return ret; > > } > > > > I know this code gets removed, so this isn't really important. > By why do you take the spinlock here? What are you racing again? > > Thanks, > NeilBrown I think I was worried about I_VERS_BUMP being set or cleared during an increment or query. It is quite possible that that spinlock is not necessary. -- Jeff Layton