All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	martin.petersen@oracle.com
Subject: Re: [PATCH 2/7] bio-integrity: save original iterator for verify stage
Date: Tue, 04 Apr 2017 15:15:39 +0300	[thread overview]
Message-ID: <878tngl66s.fsf@dmlp.sw.ru> (raw)
In-Reply-To: <20170404070122.GC12008@infradead.org>

Christoph Hellwig <hch@infradead.org> writes:

> This is a pretty big increase in the bio_integrity_payload size,
> but I guess we can't get around it..

Yes, everybody hate this solution, me too, but I've stated with
other approach and it is appeaded to be very ugly.

My idea was that we have two types of iterator incrementors: bio_advance()
and bio_xx_complete, First one is called during split, later is called
on completion ( req_bio_endio() ) . So we can add new field "bi_done" to
iterator which has similar meaning as bi_bvec_done, but at full iterator
scope.  It is incremented during completion, but before end_io.
Chain bios will propogate bi_done to parent bio to parent one.
On ->vefify_fn() iterator will be rewinded (counter part of bvec_advance) to
iter->bi_done bytes, so we will get oritinal iterator. 
I've even prepare a patch for this idea and it looks big and awful.
Even more it does not works if chained bios overlapts (raid1,raid10,
etc).

But... at the time I've wrote this email I've realized that I do not
care about what happen with chained bios. The only thing is important
is parent bio and how far it was advanced. If bi_done is incremented
inside bvec_iter_advance() I can be shure that at the moment
->bi_end_io()
original position can be restored by rewinding back to io_done bytes.

I'll try to implement this.

>
> Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2017-04-04 12:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03  7:23 [PATCH 0/7] block: T10/DIF Fixes and cleanups v2 Dmitry Monakhov
2017-04-03  7:23 ` [PATCH 1/7] bio-integrity: Do not allocate integrity context for bio w/o data Dmitry Monakhov
2017-04-04  7:00   ` Christoph Hellwig
2017-04-03  7:23 ` [PATCH 2/7] bio-integrity: save original iterator for verify stage Dmitry Monakhov
2017-04-04  7:01   ` Christoph Hellwig
2017-04-04 12:15     ` Dmitry Monakhov [this message]
2017-04-03  7:23 ` [PATCH 3/7] bio-integrity: bio_trim should truncate integrity vector accordingly Dmitry Monakhov
2017-04-04  7:01   ` Christoph Hellwig
2017-04-03  7:23 ` [PATCH 4/7] bio-integrity: fix interface for bio_integrity_trim Dmitry Monakhov
2017-04-04  7:03   ` Christoph Hellwig
2017-04-03  7:23 ` [PATCH 5/7] bio-integrity: add bio_integrity_setup helper Dmitry Monakhov
2017-04-04  7:06   ` Christoph Hellwig
2017-04-03  7:23 ` [PATCH 6/7] T10: Move opencoded contants to common header Dmitry Monakhov
2017-04-04  7:09   ` Christoph Hellwig
2017-04-03  7:23 ` [PATCH 7/7] Guard bvec iteration logic v2 Dmitry Monakhov
2017-04-03 14:34   ` Jens Axboe
2017-04-04 15:03   ` Ming Lei
2017-04-04 15:19     ` Dmitry Monakhov
2017-04-04 15:56       ` Ming Lei
2017-04-03 21:12 ` [PATCH 0/7] block: T10/DIF Fixes and cleanups v2 Martin K. Petersen

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=878tngl66s.fsf@dmlp.sw.ru \
    --to=dmonakhov@openvz.org \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.