From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tao Ma Subject: Re: [PATCH v3] ocfs2: Let ocfs2_setattr use new truncate sequence. Date: Fri, 11 Jun 2010 08:00:09 +0800 Message-ID: <4C117C89.4050600@oracle.com> References: <20100610044234.GD26335@laptop> <1276146485-9346-1-git-send-email-tao.ma@oracle.com> <20100610082711.GA2173@lst.de> <20100610084707.GG30672@mail.oracle.com> <4C10D600.60209@oracle.com> <20100610181158.GA5934@mail.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: joel Becker , Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Piggin , mfasheh@suse.com Return-path: In-Reply-To: <20100610181158.GA5934@mail.oracle.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Joel Becker wrote: > On Thu, Jun 10, 2010 at 08:09:36PM +0800, Tao Ma wrote: > >> Joel Becker wrote: >> >>> Is your concern that the u/gid checks may be against stale ids? >>> >> So I think we should have one inode_change_ok before the cluster >> lock and another after the cluster lock. >> The first one will save us a lot of cluster lock effort if the user >> pass us the wrong arguments while the later >> one will test again with the refreshed inode info. >> > > But what if the other node has given us permission, and then we > fail? Say the file was owned by you. On node 2, root sets it to be > owned by me. Then on node 1, I go to change the file permissions. > inode_change_ok() will fail, because the in-memory inode still thinks > you are the owner. > I guess it does need to be under the lock. > OK, so I will revise my patch to move it under cluster lock. Regards, Tao