diff mbox series

[v2,3/3] xfs: don't set warns on dquots

Message ID 20220505011815.20075-4-catherine.hoang@oracle.com (mailing list archive)
State New, archived
Headers show
Series xfs: remove quota warnings | expand

Commit Message

Catherine Hoang May 5, 2022, 1:18 a.m. UTC
Having just dropped support for quota warning limits and warning counters,
the warning fields no longer have any meaning. Return -EINVAL if the
fieldmask has any of the QC_*_WARNS set.

Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/xfs_qm_syscalls.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Darrick J. Wong May 5, 2022, 4:17 p.m. UTC | #1
On Wed, May 04, 2022 at 06:18:15PM -0700, Catherine Hoang wrote:
> Having just dropped support for quota warning limits and warning counters,
> the warning fields no longer have any meaning. Return -EINVAL if the
> fieldmask has any of the QC_*_WARNS set.
> 
> Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>

Slight nit I noticed in this patch: I think you should remove
QC_WARNS_MASK from XFS_QC_SETINFO_MASK and XFS_QC_MASK.  The first will
block the setting of warning counters from quotactl_ops.set_info, and
the second blocks it from quotactl_ops.set_dqblk.  With both those
#defins updated, I think you don't need the change below.

--D

> ---
>  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 2149c203b1d0..188e1fed2eba 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)
> +		return -EINVAL;
>  
>  	/*
>  	 * Get the dquot (locked) before we start, as we need to do a
> -- 
> 2.27.0
>
Allison Henderson May 5, 2022, 5:44 p.m. UTC | #2
On Wed, 2022-05-04 at 18:18 -0700, Catherine Hoang wrote:
> Having just dropped support for quota warning limits and warning
> counters,
> the warning fields no longer have any meaning. Return -EINVAL if the
> fieldmask has any of the QC_*_WARNS set.
> 
> Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>

I think it's a move in the right direction.  Thanks Catherine!
Reviewed-by: Allison Henderson <allison.henderson@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 2149c203b1d0..188e1fed2eba 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)
> +		return -EINVAL;
>  
>  	/*
>  	 * Get the dquot (locked) before we start, as we need to do a
Catherine Hoang May 5, 2022, 8:48 p.m. UTC | #3
> On May 5, 2022, at 9:17 AM, Darrick J. Wong <djwong@kernel.org> wrote:
> 
> On Wed, May 04, 2022 at 06:18:15PM -0700, Catherine Hoang wrote:
>> Having just dropped support for quota warning limits and warning counters,
>> the warning fields no longer have any meaning. Return -EINVAL if the
>> fieldmask has any of the QC_*_WARNS set.
>> 
>> Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
>> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
> 
> Slight nit I noticed in this patch: I think you should remove
> QC_WARNS_MASK from XFS_QC_SETINFO_MASK and XFS_QC_MASK.  The first will
> block the setting of warning counters from quotactl_ops.set_info, and
> the second blocks it from quotactl_ops.set_dqblk.  With both those
> #defins updated, I think you don't need the change below.
> 
> --D

Ok, that makes sense to me. I’ll add those changes, thanks!

Catherine
> 
>> ---
>> 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 2149c203b1d0..188e1fed2eba 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)
>> +		return -EINVAL;
>> 
>> 	/*
>> 	 * Get the dquot (locked) before we start, as we need to do a
>> -- 
>> 2.27.0
>>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index 2149c203b1d0..188e1fed2eba 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)
+		return -EINVAL;
 
 	/*
 	 * Get the dquot (locked) before we start, as we need to do a