linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valerie Aurora <vaurora@redhat.com>
To: Theodore Tso <tytso@MIT.EDU>
Cc: Jamie Lokier <jamie@shareable.org>,
	"J. R. Okajima" <hooanon05@yahoo.co.jp>,
	linux-fsdevel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Erez Zadok <ezk@cs.sunysb.edu>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: Union mounts and fchown/fchmod/utimensat
Date: Tue, 30 Mar 2010 16:30:35 -0400	[thread overview]
Message-ID: <20100330203035.GA7487@shell> (raw)
In-Reply-To: <DAF97B23-3C67-4776-996E-B9E09D28BD66@mit.edu>

On Tue, Mar 30, 2010 at 07:16:18AM -0400, Theodore Tso wrote:
> Hmmm....   do we also need to worry about read-only fd's of directories, and interaction with the *at() system calls.   For example:
> 
> 	int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath)
> 
> ... where olddirfd and newdirfd might be r/o file descriptors for directories participating in a Union mount?
> 
> This is just one example, of course.   There's also openat(), symlinkat(), etc.

Directories are always copied up in this version of union mounts, so
it doesn't matter whether you open a directory O_RDONLY or not, you'll
always have the topmost version and see all the effects of link(),
linkat(), rename(), renameat(), etc.  It's only with files that you
can get a stale copy if you open it O_RDONLY and it gets modified
through some other path.

Always copying up directories solves a lot of problems.  I managed to
eliminate several hundred lines of code with that change in the
design.

-VAL

  reply	other threads:[~2010-03-30 20:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 22:45 Union mounts and fchown/fchmod/utimensat Valerie Aurora
2010-03-27 15:43 ` J. R. Okajima
2010-03-29 18:39   ` Valerie Aurora
2010-03-29 23:48     ` Jamie Lokier
2010-03-30 11:16       ` Theodore Tso
2010-03-30 20:30         ` Valerie Aurora [this message]
2010-03-30 21:31       ` Valerie Aurora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100330203035.GA7487@shell \
    --to=vaurora@redhat.com \
    --cc=ezk@cs.sunysb.edu \
    --cc=hch@infradead.org \
    --cc=hooanon05@yahoo.co.jp \
    --cc=jamie@shareable.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@MIT.EDU \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).