public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/7] mkfs: check that metadata updates have been committed
Date: Tue, 25 Feb 2020 10:08:05 -0500	[thread overview]
Message-ID: <20200225150805.GB26938@bfoster> (raw)
In-Reply-To: <158258945969.451075.3231072619586225611.stgit@magnolia>

On Mon, Feb 24, 2020 at 04:10:59PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Make sure that all the metadata we wrote in the process of formatting
> the filesystem have been written correctly, or exit with failure.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  mkfs/xfs_mkfs.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 1f5d2105..1038e604 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -3940,13 +3940,16 @@ main(
>  	(XFS_BUF_TO_SBP(buf))->sb_inprogress = 0;
>  	libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
>  
> -	libxfs_umount(mp);
> +	/* Report failure if anything failed to get written to our new fs. */
> +	error = -libxfs_umount(mp);
> +	if (error)
> +		exit(1);
> +
>  	if (xi.rtdev)
>  		libxfs_device_close(xi.rtdev);
>  	if (xi.logdev && xi.logdev != xi.ddev)
>  		libxfs_device_close(xi.logdev);
>  	libxfs_device_close(xi.ddev);
>  	libxfs_destroy();
> -
>  	return 0;
>  }
> 


  reply	other threads:[~2020-02-25 15:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25  0:10 [PATCH v3 0/7] xfsprogs: actually check that writes succeeded Darrick J. Wong
2020-02-25  0:10 ` [PATCH 1/7] libxfs: libxfs_buf_delwri_submit should write buffers immediately Darrick J. Wong
2020-02-25  0:10 ` [PATCH 2/7] libxfs: complain when write IOs fail Darrick J. Wong
2020-02-25  0:10 ` [PATCH 3/7] libxfs: return flush failures Darrick J. Wong
2020-02-25  0:10 ` [PATCH 4/7] libxfs: flush all dirty buffers and report errors when unmounting filesystem Darrick J. Wong
2020-02-25 15:07   ` Brian Foster
2020-02-25 17:37   ` Christoph Hellwig
2020-02-25  0:10 ` [PATCH 5/7] mkfs: check that metadata updates have been committed Darrick J. Wong
2020-02-25 15:08   ` Brian Foster [this message]
2020-02-25 17:37   ` Christoph Hellwig
2020-02-25  0:11 ` [PATCH 6/7] xfs_repair: " Darrick J. Wong
2020-02-25 15:08   ` Brian Foster
2020-02-25 15:14     ` Darrick J. Wong
2020-02-25 17:38       ` Christoph Hellwig
2020-02-29 22:37         ` Eric Sandeen
2020-02-25 19:24   ` [PATCH v2 " Darrick J. Wong
2020-02-25  0:11 ` [PATCH 7/7] libfrog: always fsync when flushing a device Darrick J. Wong
2020-02-25 17:38   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2020-02-28 23:35 [PATCH v4 0/7] xfsprogs: actually check that writes succeeded Darrick J. Wong
2020-02-28 23:35 ` [PATCH 5/7] mkfs: check that metadata updates have been committed Darrick J. Wong

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=20200225150805.GB26938@bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --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