From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Dave Jones <davej@redhat.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
xfs@oss.sgi.com
Subject: Re: fs/attr.c:notify_change locking warning.
Date: Wed, 16 Oct 2013 00:05:28 -0700 [thread overview]
Message-ID: <20131016070528.GB18721@infradead.org> (raw)
In-Reply-To: <20131015213618.GU4446@dastard>
On Wed, Oct 16, 2013 at 08:36:18AM +1100, Dave Chinner wrote:
> Sure, but file_remove_suid() doesn't actually modify any VFS inode
> structures until we process the flags and the modifications within
> ->setattr, which in XFS are all done under the XFS_ILOCK_EXCL via
> xfs_setattr_mode(). i.e. both the VFS and XFS inodes S*ID bits are
> removed only under XFS_ILOCK_EXCL....
It can set S_NOSEC after calling into ->setattr at least.
> Hence I see no point in adding extra serialisation via the i_mutex
> to this path when we can just do something like:
>
> killsuid = should_remove_suid(file->f_path.dentry);
> if (killsuid) {
> struct iattr newattr;
>
> newattr.ia_valid = ATTR_FORCE | killsuid;
> error = xfs_setattr_nonsize(ip, &newattr, 0);
> if (error)
> return error;
> }
We'd still need all the other magic in file_remove_suid, which I don't
actually quite undersdtand fully yet.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-10-16 7:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-05 0:52 fs/attr.c:notify_change locking warning Dave Jones
2013-10-05 3:19 ` Dave Chinner
2013-10-15 20:19 ` Christoph Hellwig
2013-10-15 21:36 ` Dave Chinner
2013-10-16 7:05 ` Christoph Hellwig [this message]
2013-10-16 10:26 ` Dave Chinner
2013-10-16 18:12 ` 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=20131016070528.GB18721@infradead.org \
--to=hch@infradead.org \
--cc=davej@redhat.com \
--cc=david@fromorbit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=xfs@oss.sgi.com \
/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