All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Eric Sandeen <sandeen@redhat.com>, linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] xfs: remove XFS_QMOPT_ENOSPC flag
Date: Fri, 8 May 2020 12:21:29 -0400	[thread overview]
Message-ID: <20200508162129.GJ27577@bfoster> (raw)
In-Reply-To: <57c07fd1-9dd1-8a03-da29-2b1b99cfa2ed@sandeen.net>

On Fri, May 08, 2020 at 10:45:48AM -0500, Eric Sandeen wrote:
> On 5/8/20 8:01 AM, Brian Foster wrote:
> > On Thu, May 07, 2020 at 11:00:34PM -0500, Eric Sandeen wrote:
> >> The only place we return -EDQUOT, and therefore need to make a decision
> >> about returning -ENOSPC for project quota instead, is in xfs_trans_dqresv().
> >>
> >> So there's no reason to be setting and clearing XFS_QMOPT_ENOSPC at higher
> >> levels; if xfs_trans_dqresv has failed, test if the dqp we were were handed
> >> is a project quota and if so, return -ENOSPC instead of EDQUOT.  The
> >> complexity is just a leftover from when project & group quota were mutually
> >> exclusive and shared some codepaths.
> >>
> >> The prior patch was the trivial bugfix, this is the slightly more involved
> >> cleanup.
> >>
> >> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> >> ---
> > 
> > Hmm so what about callers that don't pass QMOPT_ENOSPC? For example, it
> > looks like various xfs_trans_reserve_quota() calls pass a pdqp but don't
> > set the flag.
> 
> Oh, interesting.  I bet that was an oversight, tbh, but let's see.
> 
> <rewinds 14 years>
> 
> commit 9a2a7de268f67fea0c450ed3e99a2d31f43d7166
> Author: Nathan Scott <nathans@sgi.com>
> Date:   Fri Mar 31 13:04:49 2006 +1000
> 
>     [XFS] Make project quota enforcement return an error code consistent with
>     its use.
> 
> so yeah, even back then, stuff like xfs_symlink returned EDQUOT not ENOSPC.
> 
> Today, these call the reservation w/o the special ENOSPC flag:
> 
> xfs_unmap_extent
> xfs_create
> xfs_create_tmpfile
> xfs_symlink
> 
> and so will return EDQUOT instead of ENOSPC even for project quota.
> 
> You're right that my patch changes these to ENOSPC.
> 
> > Is the intent to change behavior such that -ENOSPC is
> > unconditional for project quota reservation failures?
> 
> Now it's a conundrum.  I /think/ the current behavior is due to an oversight, but 
> 
> a) I'm not certain, and
> b) can we change it now?
> 

Heh, I can't really tell what the intended/expected behavior is. For
whatever it's worth, it seems reasonable enough to me to change it based
on the fact that project quotas have been expected to return -ENOSPC in
at least some common cases for many years. It seems unlikely that users
would know or care about the change in behavior in the subset noted
above, but who knows. It might be good to get some other opinions. :P

Brian

> -Eric
> 


  reply	other threads:[~2020-05-08 16:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08  3:31 [PATCH 0/2] xfs: fix project quota ENOSPC vs EDQUOT Eric Sandeen
2020-05-08  3:38 ` [PATCH 1/2] xfs: group quota should return EDQUOT when prj quota enabled Eric Sandeen
2020-05-08  7:13   ` Christoph Hellwig
2020-05-08 14:28     ` Eric Sandeen
2020-05-08 13:00   ` Brian Foster
2020-05-08  4:00 ` [PATCH 2/2] xfs: remove XFS_QMOPT_ENOSPC flag Eric Sandeen
2020-05-08  7:14   ` Christoph Hellwig
2020-05-08 13:01   ` Brian Foster
2020-05-08 15:45     ` Eric Sandeen
2020-05-08 16:21       ` Brian Foster [this message]
2020-05-12 23:34         ` Darrick J. Wong
2020-05-13 11:00           ` Brian Foster
2020-05-13 13:39             ` Eric Sandeen
2020-05-13 15:29               ` Darrick J. Wong
2020-05-13 17:39   ` [PATCH 2/2 V2] xfs: always return -ENOSPC on project quota reservation failure Eric Sandeen
2020-05-14 11:43     ` Brian Foster

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=20200508162129.GJ27577@bfoster \
    --to=bfoster@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=sandeen@sandeen.net \
    /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.