lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120423111610.0259d610@tlielax.poochiereds.net>
Date:	Mon, 23 Apr 2012 11:16:10 -0400
From:	Jeff Layton <jlayton@...hat.com>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	"J. Bruce Fields" <bfields@...ldses.org>,
	Malahal Naineni <malahal@...ibm.com>,
	Steve Dickson <SteveD@...hat.com>,
	linux-fsdevel@...r.kernel.org, linux-nfs@...r.kernel.org,
	linux-kernel@...r.kernel.org, viro@...iv.linux.org.uk,
	hch@...radead.org, michael.brantley@...haw.com,
	sven.breuner@...m.fraunhofer.de, chuck.lever@...cle.com,
	pstaubach@...grid.com, trond.myklebust@....uio.no, rees@...ch.edu
Subject: Re: [PATCH RFC v3] vfs: make fstatat retry once on ESTALE errors
 from getattr call

On Mon, 23 Apr 2012 16:51:04 +0200
Miklos Szeredi <miklos@...redi.hu> wrote:

> "J. Bruce Fields" <bfields@...ldses.org> writes:
> 
> >
> > I also wonder whether it would be making too many assumptions about the
> > server or filesystem: just because ordinary posix interfaces don't allow
> > atomic replacement of a whole directory tree doesn't mean the server
> > might not have some way to do it.
> 
> Exactly because posix limits the atomic replacement to empty directories
> is that this feature is not useful and is why linux can get away with
> the dead directory behavior in this case.  And thinking about fixing
> this in NFS is completely pointless since no one will rely on the atomic
> replacement behavior.  Fixing local filesystems is also pointless for
> the same reason.
> 
> Atomic replacement of whole directory trees would indeed be more useful,
> but it's highly unlikely to be used anywhere since applications relying
> on this feature would be limited to special filesystems that allow this.
> 
> So my statement is "ENOENT is equivalent to ESTALE if already retrying
> path lookup with LOOKUP_REVAL on any operation that takes an parent
> directory and a name (lookup, create, link, unlink, symlink, mkdir,
> rmdir, mknod, rename)."
> 

Ok, but again, that only applies to the lookup. It has no bearing on
the subsequent operation. For instance, if we're doing:

     rename("/foo", "/bar");

...and another client is simultaneously doing:

     creat("/bar/baz", 0600);

...and we get back ESTALE from the server on the create because the
"old" /bar got replaced after the lookup of it. Then it seems like
returning -ENOENT would not be correct since there was never a time
where /bar didn't exist...

It might eventually be nice to add that optimization to the path lookup
code. OTOH, it only solves a very specific problem that's not really
applicable in a lot of the cases I'm interested in fixing.

-- 
Jeff Layton <jlayton@...hat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ