From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: i_flags locking Date: Sat, 30 Jun 2007 10:30:24 +0100 Message-ID: <20070630093024.GB22354@infradead.org> References: <20070625164244.GK18198@duck.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Jan Kara Return-path: Received: from pentafluge.infradead.org ([213.146.154.40]:40480 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754446AbXF3JaZ (ORCPT ); Sat, 30 Jun 2007 05:30:25 -0400 Content-Disposition: inline In-Reply-To: <20070625164244.GK18198@duck.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, Jun 25, 2007 at 06:42:44PM +0200, Jan Kara wrote: > Hi, > > I came across the following question: What is the proper locking for > using i_flags? I've noticed i_flags are read freely without any lock. > The modifications I've seen e.g. in ext3 were done under i_mutex. Is this > right? > BTW it means that when checking i_flags we can see intermediate states > in ext3_set_inode_flags() when all flags are cleared and the proper flags > are not yet set, right? > I'm currently playing with something like inotify for subtree and I'd > need to modify i_flags but using i_mutex unpleasantly interferes with > directory locking... i_lock?