[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200225205342.GA12066@infradead.org>
Date: Tue, 25 Feb 2020 12:53:42 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Ritesh Harjani <riteshh@...ux.ibm.com>
Cc: Goldwyn Rodrigues <rgoldwyn@...e.com>, linux-ext4@...r.kernel.org,
linux-fsdevel@...r.kernel.org, hch@...radead.org,
darrick.wong@...cle.com
Subject: Re: [PATCH v2] iomap: return partial I/O count on error in
iomap_dio_bio_actor
On Fri, Feb 21, 2020 at 10:21:04AM +0530, Ritesh Harjani wrote:
> > if (dio->error) {
> > iov_iter_revert(dio->submit.iter, copied);
> > - copied = ret = 0;
> > + ret = 0;
> > goto out;
> > }
>
> But if I am seeing this correctly, even after there was a dio->error
> if you return copied > 0, then the loop in iomap_dio_rw will continue
> for next iteration as well. Until the second time it won't copy
> anything since dio->error is set and from there I guess it may return
> 0 which will break the loop.
In addition to that copied is also iov_iter_reexpand call. We don't
really need the re-expand in case of errors, and in fact we also
have the iov_iter_revert call before jumping out, so this will
need a little bit more of an audit and properly documented in the
commit log.
>
> Is this the correct flow? Shouldn't the while loop doing
> iomap_apply in iomap_dio_rw should also break in case of
> dio->error? Or did I miss anything?
We'd need something there iff we care about a good number of written
in case of the error. Goldwyn, can you explain what you need this
number for in btrfs? Maybe with a pointer to the current code base?
Powered by blists - more mailing lists