All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlos Maiolino <cmaiolino@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/3] xfs: remove support for disabling quota accounting on a mounted file system
Date: Wed, 14 Jul 2021 13:10:49 +0200	[thread overview]
Message-ID: <20210714111049.dxhrtupk46ls4ujb@omega.lan> (raw)
In-Reply-To: <20210712111426.83004-2-hch@lst.de>

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@lst.de>

> -	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@redhat.com>


-- 
Carlos


  reply	other threads:[~2021-07-14 11:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 11:14 don't allow disabling quota accounting on a mounted file system Christoph Hellwig
2021-07-12 11:14 ` [PATCH 1/3] xfs: remove support for " Christoph Hellwig
2021-07-14 11:10   ` Carlos Maiolino [this message]
2021-07-20  6:33     ` Christoph Hellwig
2021-07-14 21:44   ` Darrick J. Wong
2021-07-15 17:15   ` Darrick J. Wong
2021-07-20  6:35     ` Christoph Hellwig
2021-07-12 11:14 ` [PATCH 2/3] xfs: remove the flags argument to xfs_qm_dquot_walk Christoph Hellwig
2021-07-14 11:11   ` Carlos Maiolino
2021-07-14 21:45   ` Darrick J. Wong
2021-07-12 11:14 ` [PATCH 3/3] xfs: remove the active vs running quota differentiation Christoph Hellwig
2021-07-14 11:47   ` Carlos Maiolino
2021-07-14 21:47   ` Darrick J. Wong
2021-07-22  7:26 don't allow disabling quota accounting on a mounted file system v2 Christoph Hellwig
2021-07-22  7:26 ` [PATCH 1/3] xfs: remove support for disabling quota accounting on a mounted file system Christoph Hellwig
2021-07-22 18:22   ` Darrick J. Wong
2021-07-22 19:03     ` Christoph Hellwig
2021-07-22 19:07       ` Darrick J. Wong
2021-07-23  5:05         ` Christoph Hellwig

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=20210714111049.dxhrtupk46ls4ujb@omega.lan \
    --to=cmaiolino@redhat.com \
    --cc=hch@lst.de \
    --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 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.