From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Whitehouse Subject: Re: [PATCH 2/2] check ATTR_SIZE contraints in inode_change_ok Date: Wed, 09 Jun 2010 11:59:38 +0100 Message-ID: <1276081178.2385.2.camel@localhost> References: <20100601113915.GA4861@lst.de> <20100601113937.GB4929@lst.de> <20100609073336.GV26335@laptop> <20100609094121.GC3393@quack.suse.cz> <20100609100715.GA15837@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Jan Kara , Nick Piggin , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, mfasheh@suse.de To: Christoph Hellwig Return-path: Received: from b.painless.aaisp.net.uk ([81.187.30.52]:52641 "EHLO b.painless.aaisp.net.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755513Ab0FIKyt (ORCPT ); Wed, 9 Jun 2010 06:54:49 -0400 In-Reply-To: <20100609100715.GA15837@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, On Wed, 2010-06-09 at 12:07 +0200, Christoph Hellwig wrote: > On Wed, Jun 09, 2010 at 11:41:21AM +0200, Jan Kara wrote: > > That's a good point. For all local filesystems I know, holding i_mutex is > > enough for having stable i_size. But for clustered filesystems it > > definitely isn't. They have to hold cluster locks to be able to reliably > > check current i_size (at least OCFS2 does). Looking at what > > inode_newsize_ok currently does, i_size is only used to decide whether > > we need to check for rlimit or not. So we could falsely miss this > > check (other node is truncating the file below new offset)... Hmm, OK, so > > we really need the cluster lock... > > BTW: Mark, don't we need the cluster lock also for the permission > > checks in inode_change_ok? Otherwise we could see: > > Yes, we should have it for all of the checks. It would be good if > the cluster folks came up with proper patches for vfs.git #for-next > to fix up the cluster locking for all of ->setattr. > I already have such a patch, and as per your request, I'm only waiting for your changes in the same area to hit mainline before I merge it into my git tree to avoid conflicts in -next. If you'd like to merge the changes via the vfs tree instead, thats ok too, but let me know which, Steve.