All of lore.kernel.org
 help / color / mirror / Atom feed
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: hch@infradead.org
Cc: fujita.tomonori@lab.ntt.co.jp, axboe@kernel.dk,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/9] remove q->prepare_flush_fn hook
Date: Thu, 8 Jul 2010 08:54:59 +0900	[thread overview]
Message-ID: <20100708085404K.fujita.tomonori@lab.ntt.co.jp> (raw)
In-Reply-To: <20100707195209.GA25635@infradead.org>

On Wed, 7 Jul 2010 15:52:09 -0400
Christoph Hellwig <hch@infradead.org> wrote:

> One weird thing after this set is that the flush commands don't have any
> cmd_type.  I think it should be set to REQ_TYPE_FS, even if we might be
> resetting it inside the driver for now.

I think even before this patchset, the block layer doesn't set
rq->cmd_type on flush requests (scsi and Ode sets it in
prepare_flush_fn).

I agree that we should set rq->cmd_type. And it should be REQ_TYPE_FS
by definition.

>From a quick look, setting REQ_TYPE_FS in the block layer doesn't
cause problems to the users of flush requests.

=
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] block: set REQ_TYPE_FS on flush requests

the block layer doesn't set rq->cmd_type on flush requests. By
definition, it should be REQ_TYPE_FS (the lower layers build a command
and interpret the result of it, that is, the block layer doesn't know
the details).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 block/blk-barrier.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/block/blk-barrier.c b/block/blk-barrier.c
index eefbde8..e7fed5e 100644
--- a/block/blk-barrier.c
+++ b/block/blk-barrier.c
@@ -134,6 +134,7 @@ static void queue_flush(struct request_queue *q, unsigned which)
 	}
 
 	blk_rq_init(q, rq);
+	rq->cmd_type = REQ_TYPE_FS;
 	rq->cmd_flags = REQ_HARDBARRIER | REQ_FLUSH;
 	rq->rq_disk = q->bar_rq.rq_disk;
 	rq->end_io = end_io;
-- 
1.6.5


  reply	other threads:[~2010-07-07 23:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-03  8:45 [PATCH 0/9] remove q->prepare_flush_fn hook FUJITA Tomonori
2010-07-03  8:45 ` [PATCH 1/9] block: introduce REQ_FLUSH flag FUJITA Tomonori
2010-07-03  8:45 ` [PATCH 2/9] block: permit PREFLUSH and POSTFLUSH without prepare_flush_fn FUJITA Tomonori
2010-07-03  8:45 ` [PATCH 3/9] scsi: stop using q->prepare_flush_fn FUJITA Tomonori
2010-07-03  8:45 ` [PATCH 4/9] osdblk: " FUJITA Tomonori
2010-07-03  8:45 ` [PATCH 5/9] ps3disk: " FUJITA Tomonori
2010-07-03  8:45 ` [PATCH 6/9] dm: " FUJITA Tomonori
2010-07-03  8:45 ` [PATCH 7/9] virtio_blk: " FUJITA Tomonori
2010-07-03  8:45 ` [PATCH 8/9] ide: " FUJITA Tomonori
2010-07-03 16:48   ` David Miller
2010-07-03  8:45 ` [PATCH 9/9] block: remove q->prepare_flush_fn completely FUJITA Tomonori
2010-07-03 10:13   ` Christoph Hellwig
2010-07-03 10:02 ` [PATCH 0/9] remove q->prepare_flush_fn hook Christoph Hellwig
2010-07-05  6:55 ` Jens Axboe
2010-07-05  8:01   ` FUJITA Tomonori
2010-07-05  8:03     ` Jens Axboe
2010-07-07 19:52 ` Christoph Hellwig
2010-07-07 23:54   ` FUJITA Tomonori [this message]
2010-07-07 23:58     ` Christoph Hellwig

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=20100708085404K.fujita.tomonori@lab.ntt.co.jp \
    --to=fujita.tomonori@lab.ntt.co.jp \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.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 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.