From: Christoph Hellwig on
On Thu, Jul 08, 2010 at 08:54:59AM +0900, FUJITA Tomonori wrote:
> On Wed, 7 Jul 2010 15:52:09 -0400
> Christoph Hellwig <hch(a)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).

Indeed it didn't. But before that it matters less because
prepare_flush_fn set it before the command entered prep_fn.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: FUJITA Tomonori on
On Wed, 7 Jul 2010 15:52:09 -0400
Christoph Hellwig <hch(a)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(a)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(a)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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/