From: Dave Chinner <david@fromorbit.com>
To: Catherine Hoang <catherine.hoang@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [RFC PATCH v1 2/2] xfs: don't set warns on the id==0 dquot
Date: Fri, 22 Apr 2022 11:40:17 +1000 [thread overview]
Message-ID: <20220422014017.GV1544202@dread.disaster.area> (raw)
In-Reply-To: <20220421165815.87837-3-catherine.hoang@oracle.com>
On Thu, Apr 21, 2022 at 09:58:15AM -0700, Catherine Hoang wrote:
> Quotas are not enforced on the id==0 dquot, so the quota code uses it
> to store warning limits and timeouts. Having just dropped support for
> warning limits, this field no longer has any meaning. Return -EINVAL
> for this dquot id if the fieldmask has any of the QC_*_WARNS set.
>
> Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
> ---
> fs/xfs/xfs_qm_syscalls.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
> index e7f3ac60ebd9..bdbd5c83b08e 100644
> --- a/fs/xfs/xfs_qm_syscalls.c
> +++ b/fs/xfs/xfs_qm_syscalls.c
> @@ -290,6 +290,8 @@ xfs_qm_scall_setqlim(
> return -EINVAL;
> if ((newlim->d_fieldmask & XFS_QC_MASK) == 0)
> return 0;
> + if ((newlim->d_fieldmask & QC_WARNS_MASK) && id == 0)
> + return -EINVAL;
Why would we do this for only id == 0? This will still allow
non-zero warning values to be written to dquots that have id != 0,
but I'm not sure why we'd allow this given that the previous
patch just removed all the warning limit checking?
Which then makes me ask: why are we still reading the warning counts
from on disk dquots and writing in-memory values back to dquots?
Shouldn't xfs_dquot_to_disk() just write zeros to the warning fields
now, and xfs_dquot_from_disk() elide reading the warning counts
altogether? i.e. can we remove d_bwarns, d_iwarns and d_rtbwarns
from the struct fs_disk_quota altogether now?
Which then raises the question of whether copy_from_xfs_dqblk() and
friends should still support warn counts up in fs/quota/quota.c...?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2022-04-22 1:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 16:58 [PATCH v1 0/2] xfs: remove quota warning limits Catherine Hoang
2022-04-21 16:58 ` [PATCH v1 1/2] xfs: remove quota warning limit from struct xfs_quota_limits Catherine Hoang
2022-04-27 18:47 ` Alli
2022-04-27 20:29 ` Darrick J. Wong
2022-04-21 16:58 ` [RFC PATCH v1 2/2] xfs: don't set warns on the id==0 dquot Catherine Hoang
2022-04-22 1:40 ` Dave Chinner [this message]
2022-04-25 15:34 ` Catherine Hoang
2022-04-25 22:42 ` Dave Chinner
2022-04-29 17:20 ` Alli
2022-04-29 19:38 ` Darrick J. Wong
2022-04-27 20:29 ` Darrick J. Wong
2022-04-28 6:36 ` [xfs] 3937433c63: xfstests.xfs.153.fail kernel test robot
2022-04-25 18:19 ` [PATCH v1 0/2] xfs: remove quota warning limits Eric Sandeen
2022-04-25 22:21 ` Dave Chinner
2022-04-26 2:43 ` Darrick J. Wong
2022-04-26 4:29 ` Dave Chinner
2022-04-26 5:14 ` Darrick J. Wong
2022-04-26 14:15 ` Brian Foster
2022-04-26 14:53 ` Darrick J. Wong
2022-04-26 18:32 ` Brian Foster
2022-04-27 14:09 ` 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=20220422014017.GV1544202@dread.disaster.area \
--to=david@fromorbit.com \
--cc=catherine.hoang@oracle.com \
--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