Re: [RFC PATCH v1 2/2] xfs: don't set warns on the id==0 dquot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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;

Assuming there'll be more patches coming to turn off the rest of the
warnings counters, this is a reasonable start:

Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx>

--D

>  
>  	/*
>  	 * Get the dquot (locked) before we start, as we need to do a
> -- 
> 2.27.0
> 



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux