linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Allison Collins <allison.henderson@oracle.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>, sandeen@sandeen.net
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/4] libxfs: libxfs_buf_delwri_submit should write buffers immediately
Date: Thu, 6 Feb 2020 12:37:58 -0700	[thread overview]
Message-ID: <15d22de3-79a2-2a6d-2453-c9ecb82fee92@oracle.com> (raw)
In-Reply-To: <158086365123.2079905.12151913907904621987.stgit@magnolia>

On 2/4/20 5:47 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The whole point of libxfs_buf_delwri_submit is to submit a bunch of
> buffers for write and wait for the response.  Unfortunately, while it
> does mark the buffers dirty, it doesn't actually flush them and lets the
> cache mru flusher do it.  This is inconsistent with the kernel API,
> which actually writes the buffers and returns any IO errors.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Looks ok to me:
Reviewed-by: Allison Collins <allison.henderson@oracle.com>

> ---
>   libxfs/rdwr.c   |    3 ++-
>   mkfs/xfs_mkfs.c |   16 ++++++++++------
>   2 files changed, 12 insertions(+), 7 deletions(-)
> 
> 
> diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
> index 0d9d7202..2e9f66cc 100644
> --- a/libxfs/rdwr.c
> +++ b/libxfs/rdwr.c
> @@ -1491,9 +1491,10 @@ xfs_buf_delwri_submit(
>   
>   	list_for_each_entry_safe(bp, n, buffer_list, b_list) {
>   		list_del_init(&bp->b_list);
> -		error2 = libxfs_writebuf(bp, 0);
> +		error2 = libxfs_writebufr(bp);
>   		if (!error)
>   			error = error2;
> +		libxfs_putbuf(bp);
>   	}
>   
>   	return error;
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 5a042917..1f5d2105 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -3685,6 +3685,7 @@ main(
>   	};
>   
>   	struct list_head	buffer_list;
> +	int			error;
>   
>   	platform_uuid_generate(&cli.uuid);
>   	progname = basename(argv[0]);
> @@ -3885,16 +3886,19 @@ main(
>   		if (agno % 16)
>   			continue;
>   
> -		if (libxfs_buf_delwri_submit(&buffer_list)) {
> -			fprintf(stderr, _("%s: writing AG headers failed\n"),
> -					progname);
> +		error = -libxfs_buf_delwri_submit(&buffer_list);
> +		if (error) {
> +			fprintf(stderr,
> +	_("%s: writing AG headers failed, err=%d\n"),
> +					progname, error);
>   			exit(1);
>   		}
>   	}
>   
> -	if (libxfs_buf_delwri_submit(&buffer_list)) {
> -		fprintf(stderr, _("%s: writing AG headers failed\n"),
> -				progname);
> +	error = -libxfs_buf_delwri_submit(&buffer_list);
> +	if (error) {
> +		fprintf(stderr, _("%s: writing AG headers failed, err=%d\n"),
> +				progname, error);
>   		exit(1);
>   	}
>   
> 

  reply	other threads:[~2020-02-06 19:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  0:47 [PATCH 0/4] libxfs: actually check that writes succeeded Darrick J. Wong
2020-02-05  0:47 ` [PATCH 1/4] libxfs: libxfs_buf_delwri_submit should write buffers immediately Darrick J. Wong
2020-02-06 19:37   ` Allison Collins [this message]
2020-02-17 13:57   ` Christoph Hellwig
2020-02-19  5:42     ` Darrick J. Wong
2020-02-05  0:47 ` [PATCH 2/4] libxfs: complain when write IOs fail Darrick J. Wong
2020-02-06 19:38   ` Allison Collins
2020-02-17 13:57   ` Christoph Hellwig
2020-02-05  0:47 ` [PATCH 3/4] libxfs: return flush failures Darrick J. Wong
2020-02-06 19:38   ` Allison Collins
2020-02-19  4:38     ` Darrick J. Wong
2020-02-17 14:00   ` Christoph Hellwig
2020-02-19  4:39     ` Darrick J. Wong
2020-02-05  0:47 ` [PATCH 4/4] misc: make all tools check that metadata updates have been committed Darrick J. Wong
2020-02-06 19:38   ` Allison Collins
2020-02-19  5:42     ` Darrick J. Wong
2020-02-17 14:01   ` 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=15d22de3-79a2-2a6d-2453-c9ecb82fee92@oracle.com \
    --to=allison.henderson@oracle.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;
as well as URLs for NNTP newsgroup(s).