Re: [PATCH 1/3] xfs: remove support for disabling quota accounting on a mounted file system

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

 



On Mon, Jul 12, 2021 at 01:14:24PM +0200, Christoph Hellwig wrote:
> Disabling quota accounting is hairy, racy code with all kinds of pitfalls.
> And it has a very strange mind set, as quota accounting (unlike
> enforcement) really is a propery of the on-disk format.  There is no good
> use case for supporting this.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

> -	if ((dqtype & XFS_QMOPT_UQUOTA) && q->qi_uquotaip) {
> -		xfs_irele(q->qi_uquotaip);
> -		q->qi_uquotaip = NULL;
> -	}
> -	if ((dqtype & XFS_QMOPT_GQUOTA) && q->qi_gquotaip) {
> -		xfs_irele(q->qi_gquotaip);
> -		q->qi_gquotaip = NULL;
> -	}
> -	if ((dqtype & XFS_QMOPT_PQUOTA) && q->qi_pquotaip) {
> -		xfs_irele(q->qi_pquotaip);
> -		q->qi_pquotaip = NULL;
> -	}
> +	mutex_lock(&mp->m_quotainfo->qi_quotaofflock);
> +	mp->m_qflags &= ~(flags & XFS_ALL_QUOTA_ENFD);
> +	spin_lock(&mp->m_sb_lock);
> +	mp->m_sb.sb_qflags = mp->m_qflags;
> +	spin_unlock(&mp->m_sb_lock);
> +	mutex_unlock(&mp->m_quotainfo->qi_quotaofflock);
>  
> -out_unlock:
> -	if (error && qoffstart)
> -		xfs_qm_qoff_logitem_relse(qoffstart);
> -	mutex_unlock(&q->qi_quotaofflock);
> -	return error;
> +	/* XXX what to do if error ? Revert back to old vals incore ? */
> +	return xfs_sync_sb(mp, false);

May be too strict, but I wonder if we shouldn't shut the FS down in case we fail
here?


Patch looks good though.

Reviewed-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>


-- 
Carlos




[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