linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Allison Henderson <allison.henderson@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>, sandeen@sandeen.net
Cc: Christoph Hellwig <hch@lst.de>, Brian Foster <bfoster@redhat.com>,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH 6/7] xfs_repair: clear quota CHKD flags on the incore superblock too
Date: Tue, 23 Feb 2021 13:18:50 -0700	[thread overview]
Message-ID: <8f618e7b-bf7c-e711-cf4e-760299f364dc@oracle.com> (raw)
In-Reply-To: <161404925290.425352.17614643483707405953.stgit@magnolia>



On 2/22/21 8:00 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> At the end of a repair run, xfs_repair clears the superblock's quota
> checked flags if it found mistakes in the quota accounting to force a
> quotacheck at the next mount.  This is currently the last time repair
> modifies the primary superblock, so it is sufficient to update the
> ondisk buffer and not the incore mount structure.
> 
> However, we're about to introduce code to clear the needsrepair feature
> at the very end of repair, after all metadata blocks have been written
> to disk and all disk caches flush.  Since the convention everywhere else
> in xfs is to update the incore superblock, call libxfs_sb_to_disk to
> translate that into the ondisk buffer, and then write the buffer to
> disk, switch the quota CHKD code to use this mechanism too.
> 
> (Get rid of dsb too, since the incore super should be in sync with the
> ondisk super.)
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Brian Foster <bfoster@redhat.com>
Ok, makes sense
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>

> ---
>   repair/xfs_repair.c |   12 ++++--------
>   1 file changed, 4 insertions(+), 8 deletions(-)
> 
> 
> diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
> index 9409f0d8..40352458 100644
> --- a/repair/xfs_repair.c
> +++ b/repair/xfs_repair.c
> @@ -717,7 +717,6 @@ main(int argc, char **argv)
>   {
>   	xfs_mount_t	*temp_mp;
>   	xfs_mount_t	*mp;
> -	xfs_dsb_t	*dsb;
>   	struct xfs_buf	*sbp;
>   	xfs_mount_t	xfs_m;
>   	struct xlog	log = {0};
> @@ -1103,22 +1102,19 @@ _("Warning:  project quota information would be cleared.\n"
>   	if (!sbp)
>   		do_error(_("couldn't get superblock\n"));
>   
> -	dsb = sbp->b_addr;
> -
>   	if ((mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD) != quotacheck_results()) {
>   		do_warn(_("Note - quota info will be regenerated on next "
>   			"quota mount.\n"));
> -		dsb->sb_qflags &= cpu_to_be16(~(XFS_UQUOTA_CHKD |
> -						XFS_GQUOTA_CHKD |
> -						XFS_PQUOTA_CHKD |
> -						XFS_OQUOTA_CHKD));
> +		mp->m_sb.sb_qflags &= ~(XFS_UQUOTA_CHKD | XFS_GQUOTA_CHKD |
> +					XFS_PQUOTA_CHKD | XFS_OQUOTA_CHKD);
> +		libxfs_sb_to_disk(sbp->b_addr, &mp->m_sb);
>   	}
>   
>   	if (copied_sunit) {
>   		do_warn(
>   _("Note - stripe unit (%d) and width (%d) were copied from a backup superblock.\n"
>     "Please reset with mount -o sunit=<value>,swidth=<value> if necessary\n"),
> -			be32_to_cpu(dsb->sb_unit), be32_to_cpu(dsb->sb_width));
> +			mp->m_sb.sb_unit, mp->m_sb.sb_width);
>   	}
>   
>   	libxfs_buf_mark_dirty(sbp);
> 

  reply	other threads:[~2021-02-23 20:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23  3:00 [PATCHSET v6 0/7] xfsprogs: add the ability to flag a fs for repair Darrick J. Wong
2021-02-23  3:00 ` [PATCH 1/7] xfs_admin: clean up string quoting Darrick J. Wong
2021-02-23 20:18   ` Allison Henderson
2021-02-23  3:00 ` [PATCH 2/7] xfs_admin: support filesystems with realtime devices Darrick J. Wong
2021-02-23 20:18   ` Allison Henderson
2021-02-23  3:00 ` [PATCH 3/7] xfs_db: report the needsrepair flag in check and version commands Darrick J. Wong
2021-02-23 20:18   ` Allison Henderson
2021-02-25  8:11   ` Christoph Hellwig
2021-02-23  3:00 ` [PATCH 4/7] xfs_db: don't allow label/uuid setting if the needsrepair flag is set Darrick J. Wong
2021-02-23 20:18   ` Allison Henderson
2021-02-25  8:13   ` Christoph Hellwig
2021-02-23  3:00 ` [PATCH 5/7] xfs_repair: fix unmount error message to have a newline Darrick J. Wong
2021-02-23 20:18   ` Allison Henderson
2021-02-23  3:00 ` [PATCH 6/7] xfs_repair: clear quota CHKD flags on the incore superblock too Darrick J. Wong
2021-02-23 20:18   ` Allison Henderson [this message]
2021-02-23  3:00 ` [PATCH 7/7] xfs_repair: clear the needsrepair flag Darrick J. Wong
2021-02-23 20:18   ` Allison Henderson

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=8f618e7b-bf7c-e711-cf4e-760299f364dc@oracle.com \
    --to=allison.henderson@oracle.com \
    --cc=bfoster@redhat.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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;
as well as URLs for NNTP newsgroup(s).