From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/3] xfs: actually account for quota changes in xfs_swap_extents
Date: Tue, 12 May 2020 16:42:33 -0700 [thread overview]
Message-ID: <20200512234233.GR6714@magnolia> (raw)
In-Reply-To: <20200507060205.GA3523@infradead.org>
On Wed, May 06, 2020 at 11:02:05PM -0700, Christoph Hellwig wrote:
> On Wed, May 06, 2020 at 09:34:24AM -0700, Darrick J. Wong wrote:
> > On Wed, May 06, 2020 at 07:57:28AM -0700, Christoph Hellwig wrote:
> > > On Mon, May 04, 2020 at 06:10:29PM -0700, Darrick J. Wong wrote:
> > > > From: Darrick J. Wong <darrick.wong@oracle.com>
> > > >
> > > > Currently, xfs_swap_extents neither checks for sufficient quota
> > > > reservation nor does it actually update quota counts when swapping the
> > > > extent forks. While the primary known user of extent swapping (xfs_fsr)
> > > > is careful to ensure that the user/group/project ids of both files
> > > > match, this is not required by the kernel. Consequently, unprivileged
> > > > userspace can cause the quota counts to be incorrect.
> > >
> > > Wouldn't be the right fix to enforce an id match? I think that is a
> > > very sensible limitation.
> >
> > One could do that, but at a cost of breaking any userspace program that
> > was using XFS_IOC_SWAPEXT and was not aware that the ids had to match
> > (possibly due to the lack of documentation...)
>
> I don't really expect that to be the case. I'd throw in the check
> and a printk_once warning, and I bet a beer at the next conference
> (if there ever is one :)) that no one will trigger it.
<shrug> I guess I can at least see if fstests fails if you don't allow
swapping between extents with different [ugp]ids, but this really feels
like cutting corners off the quota functionality... :P
--D
prev parent reply other threads:[~2020-05-12 23:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 1:10 [PATCH 0/3] xfs: random SWAPEXT fixes Darrick J. Wong
2020-05-05 1:10 ` [PATCH 1/3] xfs: clean up the error handling in xfs_swap_extents Darrick J. Wong
2020-05-06 14:46 ` Christoph Hellwig
2020-05-05 1:10 ` [PATCH 2/3] xfs: clean up the metadata validation in xfs_swap_extent_rmap Darrick J. Wong
2020-05-06 14:56 ` Christoph Hellwig
2020-05-06 16:45 ` Darrick J. Wong
2020-05-05 1:10 ` [PATCH 3/3] xfs: actually account for quota changes in xfs_swap_extents Darrick J. Wong
2020-05-06 14:57 ` Christoph Hellwig
2020-05-06 16:34 ` Darrick J. Wong
2020-05-07 6:02 ` Christoph Hellwig
2020-05-12 23:42 ` Darrick J. Wong [this message]
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=20200512234233.GR6714@magnolia \
--to=darrick.wong@oracle.com \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
/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