From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: fgetattr/fsetattr file operation Date: Mon, 8 Jun 2009 02:59:43 +0100 Message-ID: <20090608015943.GM15426@shareable.org> References: <20090604190424.GI9002@webber.adilger.int> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: brian.molnar@gmail.com, adilger@sun.com, linux-fsdevel@vger.kernel.org To: Miklos Szeredi Return-path: Received: from mail2.shareable.org ([80.68.89.115]:54881 "EHLO mail2.shareable.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752809AbZFHB7n (ORCPT ); Sun, 7 Jun 2009 21:59:43 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Miklos Szeredi wrote: > On Thu, 4 Jun 2009, Brian Molnar wrote: > > > On Thu, Jun 4, 2009 at 12:04 PM, Andreas Dilger = wrote: > > > This sounds very strange - different processes (or even the same > > > process using different file handles) will see different results > > > for fstat() which are yet different from stat(). =A0I can't imagi= ne > > > that applications would like this at all. > >=20 > > Ya, no doubt a good deal of applications would get very confused if > > they didn't know the difference. And it is not the goal of this FS = to > > support the use of general applications. >=20 > Actually, well written applications shouldn't assume that > fd=3Dopen(path);fstat(fd) is equivalent to fd=3Dopen(path);stat(path)= =2E > Why? Because the second one is racy wrt. remove and rename. No, but well written applications can and do assume this: st1=3Dstat(path) ...time passes, maybe do some filesystem operations, talk on the ne= twork... fd=3Dopen(path) st2=3Dfstat(fd) if (st1!=3Dst2) abort or loop "Race happened, something changed under me..." -- Jamie -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html