From: viro@parcelfarce.linux.theplanet.co.uk
To: Bryan Henderson <hbryan@us.ibm.com>
Cc: linux-fsdevel@vger.kernel.org, Shaya Potter <spotter@cs.columbia.edu>
Subject: Re: [long] per-mountpoint readonly
Date: Thu, 29 May 2003 20:22:13 +0100 [thread overview]
Message-ID: <20030529192213.GR14138@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <OFE38352BF.25F8A26E-ON87256D35.00577577-88256D35.0059F043@us.ibm.com>
On Thu, May 29, 2003 at 09:24:00AM -0700, Bryan Henderson wrote:
>
>
>
>
> >OW, that check (IS_RDONLY and (regular|directory|symlink) ==> EROFS)
> >should be moved into fs/namei.c::permission().
>
> permission() is the wrong place for that. I'm not saying it wouldn't work
> there, but it's conceptually wrong and would make for mistakes in the
> future. The EROFS failure has nothing to do with permission; it has to do
> with basic capabilities of the filesystem image (or in this proposal, of
> the mount). If it were a question of permission, then the identity and
> authority of the user would be involved.
Have you actually read past that point? It does _not_ stay in permission() -
as described below.
> I've already seen a case of strange programming results because some but
> not all the programmers in a certain area believed that rejecting writes to
> a r/o filesystem image was a question of permission. I did a create/open
> of a file via a r/o mount and the open failed with EROFS, but the file got
> created anyway!
IOW, you have not...
> I believe there is a fundamental difference between saying, "one who
> accesses this file via this name can't write to it" and "one can't write to
> this filesystem via this filesystem image (struct superblock). The latter
> may have implications for locking in shared filesystems and for caching.
> It may even be implemented in some component downstream of Linux. Both
> kinds of r/o are good, though. I'd like to see both.
Yes, and? In the final variant filesystem is free to reject the request for
write access. And instead of having it done as a check at one point in
the operation (which is vulnerable to remount races, for obvious reasons)
we end with request write access / do the job / give up write access. Write
access to fs - not to any given object on it; permissions checks do stay
where they currently are.
And yes, it doesn't belong to permission(9). Or to ->permission() (as it's
currently done). It belongs in places where VFS decides that it will need
to modify objects on the filesystem - before asking if it's allowed to
do something to specific objects. Mixing it with permission checks for
objects is, indeed, bogus.
next prev parent reply other threads:[~2003-05-29 19:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-29 0:55 changing permission()/vfs_permission... to work on dentry viro
2003-05-29 4:20 ` Shaya Potter
2003-05-29 4:38 ` Chris Wright
2003-05-29 8:27 ` viro
2003-05-29 8:21 ` [long] per-mountpoint readonly viro
2003-05-29 9:02 ` Trond Myklebust
2003-05-29 9:31 ` viro
2003-05-29 9:42 ` Christoph Hellwig
2003-05-29 16:24 ` Bryan Henderson
2003-05-29 19:22 ` viro [this message]
2003-05-29 21:30 ` Bryan Henderson
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=20030529192213.GR14138@parcelfarce.linux.theplanet.co.uk \
--to=viro@parcelfarce.linux.theplanet.co.uk \
--cc=hbryan@us.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=spotter@cs.columbia.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.