All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-xfs@vger.kernel.org, libc-alpha@sourceware.org,
	linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk,
	Rich Felker <dalias@libc.org>
Subject: Re: XFS reports lchmod failure, but changes file system contents
Date: Wed, 12 Feb 2020 20:15:08 +0100	[thread overview]
Message-ID: <87d0ajmxc3.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <20200212183718.GQ6870@magnolia> (Darrick J. Wong's message of "Wed, 12 Feb 2020 10:37:18 -0800")

* Darrick J. Wong:

> On Wed, Feb 12, 2020 at 10:11:28AM -0800, Christoph Hellwig wrote:
>> On Wed, Feb 12, 2020 at 08:16:04AM -0800, Darrick J. Wong wrote:
>> > xfs_setattr_nonsize calls posix_acl_chmod which returns EOPNOTSUPP
>> > because the xfs symlink inode_operations do not include a ->set_acl
>> > pointer.
>> > 
>> > I /think/ that posix_acl_chmod code exists to enforce that the file mode
>> > reflects any acl that might be set on the inode, but in this case the
>> > inode is a symbolic link.
>> > 
>> > I don't remember off the top of my head if ACLs are supposed to apply to
>> > symlinks, but what do you think about adding get_acl/set_acl pointers to
>> > xfs_symlink_inode_operations and xfs_inline_symlink_inode_operations ?
>> 
>> Symlinks don't have permissions or ACLs, so adding them makes no
>> sense.
>
> Ahh, I thought so!
>
>> xfs doesn't seem all that different from the other file systems,
>> so I suspect you'll also see it with other on-disk file systems.
>
> Yeah, I noticed that btrfs seems to exhibit the same behavior.
>
> I also noticed that ext4 actually /does/ implement [gs]et_acl for
> symlinks.

Rich Felker noticed this, which may be related:

| Further, I've found some inconsistent behavior with ext4: chmod on the
| magic symlink fails with EOPNOTSUPP as in Florian's test, but fchmod
| on the O_PATH fd succeeds and changes the symlink mode. This is with
| 5.4. Cany anyone else confirm this? Is it a problem?

It looks broken to me because fchmod (as an inode-changing operation)
is not supposed to work on O_PATH descriptors.

  reply	other threads:[~2020-02-12 19:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 11:48 XFS reports lchmod failure, but changes file system contents Florian Weimer
2020-02-12 12:15 ` Florian Weimer
2020-02-12 16:16 ` Darrick J. Wong
2020-02-12 18:11   ` Christoph Hellwig
2020-02-12 18:37     ` Darrick J. Wong
2020-02-12 19:15       ` Florian Weimer [this message]
2020-02-12 19:51         ` Al Viro
2020-02-12 19:55           ` Rich Felker
2020-02-12 20:01           ` Florian Weimer
2020-02-12 20:17             ` Andreas Schwab
2020-02-12 20:19               ` Rich Felker
2020-02-12 20:26                 ` Florian Weimer
2020-02-12 20:38                   ` Rich Felker
2020-02-12 20:27                 ` Al Viro
2020-02-12 20:36                   ` Rich Felker
2020-02-12 20:18             ` Rich Felker
2020-02-12 20:38             ` Paul Eggert
2020-02-21  4:09             ` Aleksa Sarai
2020-02-21  5:02               ` Al Viro
2020-02-21  5:21                 ` Aleksa Sarai
2020-02-12 18:50     ` Florian Weimer
2020-02-12 18:55       ` Christoph Hellwig

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=87d0ajmxc3.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=dalias@libc.org \
    --cc=darrick.wong@oracle.com \
    --cc=hch@infradead.org \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --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 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.