[dm-devel] [PATCH 11/14] barriers

Mikulas Patocka mpatocka at redhat.com
Mon Feb 23 19:22:28 UTC 2009


Move test for not-supported barriers to __make_request.

This test is sensible only for drivers that use requests (such as disk
drivers), not for drivers that use bios (such as device mapper).

It is better to fix it in generic code than to make workaround for it
in device mapper.

Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>

---
 block/blk-core.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Index: linux-2.6.29-rc6-devel/block/blk-core.c
===================================================================
--- linux-2.6.29-rc6-devel.orig/block/blk-core.c	2009-02-23 18:43:37.000000000 +0100
+++ linux-2.6.29-rc6-devel/block/blk-core.c	2009-02-23 18:44:27.000000000 +0100
@@ -1145,6 +1145,12 @@ static int __make_request(struct request
 	const int unplug = bio_unplug(bio);
 	int rw_flags;
 
+	if (bio_barrier(bio) && bio_has_data(bio) &&
+	    (q->next_ordered == QUEUE_ORDERED_NONE)) {
+		bio_endio(bio, -EOPNOTSUPP);
+		return 0;
+	}
+
 	nr_sectors = bio_sectors(bio);
 
 	/*
@@ -1450,11 +1456,6 @@ static inline void __generic_make_reques
 			err = -EOPNOTSUPP;
 			goto end_io;
 		}
-		if (bio_barrier(bio) && bio_has_data(bio) &&
-		    (q->next_ordered == QUEUE_ORDERED_NONE)) {
-			err = -EOPNOTSUPP;
-			goto end_io;
-		}
 
 		ret = q->make_request_fn(q, bio);
 	} while (ret);




More information about the dm-devel mailing list