From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: Christoph Hellwig <hch@infradead.org>,
Ritesh Harjani <riteshh@linux.ibm.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"darrick.wong@oracle.com" <darrick.wong@oracle.com>
Subject: Re: [PATCH v2] iomap: return partial I/O count on error in iomap_dio_bio_actor
Date: Wed, 26 Feb 2020 02:12:40 +0000 [thread overview]
Message-ID: <BYAPR04MB58167849C121A55413A88012E7EA0@BYAPR04MB5816.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20200225205342.GA12066@infradead.org
On 2020/02/26 5:53, Christoph Hellwig wrote:
> 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?
Not sure about btrfs, but for zonefs, getting the partial I/O count done for a
failed large dio would also be useful to avoid having to do the error recovery
dance with report zones for getting the current zone write pointer.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2020-02-26 2:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-20 15:23 [PATCH v2] iomap: return partial I/O count on error in iomap_dio_bio_actor Goldwyn Rodrigues
2020-02-20 17:42 ` Matthew Wilcox
2020-02-21 2:06 ` Goldwyn Rodrigues
2020-02-21 4:51 ` Ritesh Harjani
2020-02-21 12:48 ` Goldwyn Rodrigues
2020-02-25 20:53 ` Christoph Hellwig
2020-02-26 2:12 ` Damien Le Moal [this message]
2020-02-26 2:55 ` Goldwyn Rodrigues
2020-02-28 19:44 ` Goldwyn Rodrigues
2020-02-28 19:59 ` Matthew Wilcox
2020-02-28 20:35 ` Goldwyn Rodrigues
2020-03-02 13:31 ` Christoph Hellwig
2020-02-21 13:14 ` David Sterba
2020-02-20 15:24 Goldwyn Rodrigues
2020-03-19 15:08 Goldwyn Rodrigues
2020-03-20 14:05 ` Christoph Hellwig
2020-03-20 14:23 ` Josef Bacik
2020-03-20 14:35 ` Christoph Hellwig
2020-03-20 15:35 ` Goldwyn Rodrigues
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=BYAPR04MB58167849C121A55413A88012E7EA0@BYAPR04MB5816.namprd04.prod.outlook.com \
--to=damien.lemoal@wdc.com \
--cc=darrick.wong@oracle.com \
--cc=hch@infradead.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=rgoldwyn@suse.com \
--cc=riteshh@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).