From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian Molnar Subject: Re: fgetattr/fsetattr file operation Date: Mon, 8 Jun 2009 15:26:07 -0700 Message-ID: References: <20090604190424.GI9002@webber.adilger.int> <20090608015943.GM15426@shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Miklos Szeredi , adilger@sun.com, linux-fsdevel@vger.kernel.org To: Jamie Lokier Return-path: Received: from mail-gx0-f214.google.com ([209.85.217.214]:57821 "EHLO mail-gx0-f214.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838AbZFHW0G convert rfc822-to-8bit (ORCPT ); Mon, 8 Jun 2009 18:26:06 -0400 Received: by gxk10 with SMTP id 10so2379246gxk.13 for ; Mon, 08 Jun 2009 15:26:07 -0700 (PDT) In-Reply-To: <20090608015943.GM15426@shareable.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > On Sun, Jun 7, 2009 at 6:59 PM, Jamie Lokier wro= te: > No, but well written applications can and do assume this: > > =A0 =A0st1=3Dstat(path) > > =A0 =A0...time passes, maybe do some filesystem operations, talk on t= he network... > > =A0 =A0fd=3Dopen(path) > =A0 =A0st2=3Dfstat(fd) > > =A0 =A0if (st1!=3Dst2) > =A0 =A0 =A0 =A0abort or loop "Race happened, something changed under = me..." > > -- Jamie > Well certainly applications can still make *that* assumption on this file system, but generally, due to the special semantics of certain types of file access (more specifically, when it comes to writing and appending to files), it's expected that some applications may simply not work with this FS. Applications utilizing this filesystem must be aware of these cases, with the expectation that some can use them to their advantage. So far, the VFS interface (and by extension, the FUSE interface) has managed to facilitate most of this functionality, but the missing piece is in the metadata. To achieve the desired behavior, it is necessary to associate a private set of metadata with an opened file descriptor. And to do so requires access directly to private data stored in the underlying file struct during the getattr operation when the fstat(2) is called. Cheers, - Brian -- 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