Re: [PATCH 0/9] remove q->prepare_flush_fn hook

From: FUJITA Tomonori
Date: Wed Jul 07 2010 - 19:55:19 EST


On Wed, 7 Jul 2010 15:52:09 -0400
Christoph Hellwig <hch@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/