linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: linux-fsdevel@vger.kernel.org, riteshh@linux.ibm.com,
	linux-ext4@vger.kernel.org, hch@infradead.org,
	darrick.wong@oracle.com, willy@infradead.org,
	linux-btrfs@vger.kernel.org, Josef Bacik <josef@toxicpanda.com>
Subject: Re: [PATCH v2] iomap: return partial I/O count on error in iomap_dio_bio_actor
Date: Fri, 20 Mar 2020 07:05:38 -0700	[thread overview]
Message-ID: <20200320140538.GA27895@infradead.org> (raw)
In-Reply-To: <20200319150805.uaggnfue5xgaougx@fiona>

I spent a fair amount of time looking over this change, and I am
starting to feel very bad about it.  iomap_apply() has pretty clear
semantics of either return an error, or return the bytes processed,
and in general these semantics work just fine.

The thing that breaks this concept is the btrfs submit_bio hook,
which allows the file system to keep state for each bio actually
submitted.  But I think you can simply keep the length internally
in btrfs - use the space in iomap->private as a counter of how
much was allocated, pass the iomap to the submit_io hook, and
update it there, and then deal with the rest in ->iomap_end.

That assumes ->iomap_end actually is the right place - can someone
explain what the expected call site for __endio_write_update_ordered
is?  It kinda sorta looks to me like something that would want to
be called after I/O completion, not after I/O submission, but maybe
I misunderstand the code.

  reply	other threads:[~2020-03-20 14:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 15:08 [PATCH v2] iomap: return partial I/O count on error in iomap_dio_bio_actor Goldwyn Rodrigues
2020-03-20 14:05 ` Christoph Hellwig [this message]
2020-03-20 14:23   ` Josef Bacik
2020-03-20 14:35     ` Christoph Hellwig
2020-03-20 15:35       ` Goldwyn Rodrigues
  -- strict thread matches above, loose matches on Subject: below --
2020-02-20 15:24 Goldwyn Rodrigues
2020-02-20 15:23 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
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

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=20200320140538.GA27895@infradead.org \
    --to=hch@infradead.org \
    --cc=darrick.wong@oracle.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rgoldwyn@suse.de \
    --cc=riteshh@linux.ibm.com \
    --cc=willy@infradead.org \
    /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).