Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	kernel test robot <oliver.sang@intel.com>,
	Cyril Hrubis <chrubis@suse.cz>
Subject: Re: [PATCH 1/2] iomap: fix a regression for partial write errors
Date: Fri, 14 Jul 2023 07:51:48 -0700	[thread overview]
Message-ID: <20230714145148.GW108251@frogsfrogsfrogs> (raw)
In-Reply-To: <20230714085124.548920-1-hch@lst.de>

On Fri, Jul 14, 2023 at 10:51:23AM +0200, Christoph Hellwig wrote:
> When write* wrote some data it should return the amount of written data
> and not the error code that caused it to stop.  Fix a recent regression
> in iomap_file_buffered_write that caused it to return the errno instead.
> 
> Fixes: 219580eea1ee ("iomap: update ki_pos in iomap_file_buffered_write")
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Reported-by: Cyril Hrubis <chrubis@suse.cz>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Simple enough reversion, sorry for the breakage...

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/iomap/buffered-io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index adb92cdb24b009..7cc9f7274883a5 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -872,7 +872,7 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i,
>  	while ((ret = iomap_iter(&iter, ops)) > 0)
>  		iter.processed = iomap_write_iter(&iter, i);
>  
> -	if (unlikely(ret < 0))
> +	if (unlikely(iter.pos == iocb->ki_pos))
>  		return ret;
>  	ret = iter.pos - iocb->ki_pos;
>  	iocb->ki_pos += ret;
> -- 
> 2.39.2
> 

  parent reply	other threads:[~2023-07-14 14:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14  8:51 [PATCH 1/2] iomap: fix a regression for partial write errors Christoph Hellwig
2023-07-14  8:51 ` [PATCH 2/2] iomap: micro optimize the ki_pos assignment in iomap_file_buffered_write Christoph Hellwig
2023-07-14 14:52   ` Darrick J. Wong
2023-07-17  5:14   ` Ritesh Harjani
2023-07-14 14:51 ` Darrick J. Wong [this message]
2023-07-17  5:12 ` [PATCH 1/2] iomap: fix a regression for partial write errors Ritesh Harjani

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=20230714145148.GW108251@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=chrubis@suse.cz \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=oliver.sang@intel.com \
    /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