Skip to contentSkip to conversation

block: silently error unsupported empty barriers too

PATCH RESEND Superseded Mark McLoughlin 4 participants 7 messages Sep 3, 2009 – Oct 23, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 block: silently error unsupported empty barriers too

With 2.6.31-rc5 in a KVM guest using dm and virtio_blk, we see the following errors:

end_request: I/O error, dev vda, sector 0
end_request: I/O error, dev vda, sector 0

The errors go away if dm stops submitting empty barriers, by reverting:

commit 52b1fd5a27c625c78373e024bf570af3c9d44a79
Author: Mikulas Patocka <[email protected]>
dm: send empty barriers to targets in dm_flush

We should error all barriers, even empty barriers, on devices like virtio_blk which don't support them.

See also:

https://bugzilla.redhat.com/514901

Cc Rusty Russell <[email protected]>
Cc Mikulas Patocka <[email protected]>
Cc Alasdair G Kergon <[email protected]>
Cc Neil Brown <[email protected]>
Cc Christoph Hellwig <[email protected]>
---
 block/blk-core.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
block/blk-core.c +1 -2
index e3299a7..35ad2bb 100644
@@ -1163,8 +1163,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
 	const int unplug = bio_unplug(bio);
 	int rw_flags;
 
-	if (bio_barrier(bio) && bio_has_data(bio) &&
-	    (q->next_ordered == QUEUE_ORDERED_NONE)) {
+	if (bio_barrier(bio) && (q->next_ordered == QUEUE_ORDERED_NONE)) {
 		bio_endio(bio, -EOPNOTSUPP);
 		return 0;
 	}
Signature · 1 line
1.6.4
Acked-by Alasdair G Kergon Acked-by Mikulas Patocka on v1 1/1
#5 lore raw
In reply to Mark McLoughlin
Quoted 34 lines · Mark McLoughlin

With 2.6.31-rc5 in a KVM guest using dm and virtio_blk, we see the following errors:

end_request: I/O error, dev vda, sector 0
end_request: I/O error, dev vda, sector 0

The errors go away if dm stops submitting empty barriers, by reverting:

commit 52b1fd5a27c625c78373e024bf570af3c9d44a79
Author: Mikulas Patocka <[email protected]>
dm: send empty barriers to targets in dm_flush

We should error all barriers, even empty barriers, on devices like virtio_blk which don't support them.

See also:

https://bugzilla.redhat.com/514901

Cc Rusty Russell <[email protected]>
Cc Mikulas Patocka <[email protected]>
Cc Alasdair G Kergon <[email protected]>
Cc Neil Brown <[email protected]>
Cc Christoph Hellwig <[email protected]>
---
 block/blk-core.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
block/blk-core.c +0 -0
index e3299a7..35ad2bb 100644

block/blk-core.c static int __make_request(struct request_queue *q, struct bio *bio) · line 1169

Quoted 9 lines
block/blk-core.c +1 -2
@@ -1163,8 +1163,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
 	const int unplug = bio_unplug(bio);
 	int rw_flags;
 
-	if (bio_barrier(bio) && bio_has_data(bio) &&
-	    (q->next_ordered == QUEUE_ORDERED_NONE)) {
+	if (bio_barrier(bio) && (q->next_ordered == QUEUE_ORDERED_NONE)) {
 		bio_endio(bio, -EOPNOTSUPP);
 		return 0;
 	}

Jens,

Any chance we can get this fix upstream for 2.6.32? I refreshed the patch to work on 2.6.32-rc5:

From: Mark McLoughlin <[email protected]>

With 2.6.32-rc5 in a KVM guest using dm and virtio_blk, we see the following errors:

end_request: I/O error, dev vda, sector 0
end_request: I/O error, dev vda, sector 0

The errors go away if dm stops submitting empty barriers, by reverting:

commit 52b1fd5a27c625c78373e024bf570af3c9d44a79
Author: Mikulas Patocka <[email protected]>
dm: send empty barriers to targets in dm_flush

We should silently error all barriers, even empty barriers, on devices like virtio_blk which don't support them.

See also:

https://bugzilla.redhat.com/514901

---
 block/blk-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block/blk-core.c +0 -0
index ac0fa10..71da511 100644
@@ -1161,7 +1161,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
	const unsigned int ff = bio->bi_rw & REQ_FAILFAST_MASK;
	int rw_flags;

- if (bio_rw_flagged(bio, BIO_RW_BARRIER) && bio_has_data(bio) &&
+ if (bio_rw_flagged(bio, BIO_RW_BARRIER) &&

	    (q->next_ordered == QUEUE_ORDERED_NONE)) {
		bio_endio(bio, -EOPNOTSUPP);
		return 0;
Acked-by Alasdair G Kergon Acked-by Mikulas Patocka on v1 1/1
#6 lore raw
In reply to Mark McLoughlin
Quoted 34 lines · Mark McLoughlin

With 2.6.31-rc5 in a KVM guest using dm and virtio_blk, we see the following errors:

end_request: I/O error, dev vda, sector 0
end_request: I/O error, dev vda, sector 0

The errors go away if dm stops submitting empty barriers, by reverting:

commit 52b1fd5a27c625c78373e024bf570af3c9d44a79
Author: Mikulas Patocka <[email protected]>
dm: send empty barriers to targets in dm_flush

We should error all barriers, even empty barriers, on devices like virtio_blk which don't support them.

See also:

https://bugzilla.redhat.com/514901

Cc Rusty Russell <[email protected]>
Cc Mikulas Patocka <[email protected]>
Cc Alasdair G Kergon <[email protected]>
Cc Neil Brown <[email protected]>
Cc Christoph Hellwig <[email protected]>
---
 block/blk-core.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
block/blk-core.c +0 -0
index e3299a7..35ad2bb 100644

block/blk-core.c static int __make_request(struct request_queue *q, struct bio *bio) · line 1169

Quoted 9 lines
block/blk-core.c +1 -2
@@ -1163,8 +1163,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
 	const int unplug = bio_unplug(bio);
 	int rw_flags;
 
-	if (bio_barrier(bio) && bio_has_data(bio) &&
-	    (q->next_ordered == QUEUE_ORDERED_NONE)) {
+	if (bio_barrier(bio) && (q->next_ordered == QUEUE_ORDERED_NONE)) {
 		bio_endio(bio, -EOPNOTSUPP);
 		return 0;
 	}

Jens,

Any chance we can get this fix upstream for 2.6.32? I refreshed the patch to work on 2.6.32-rc5:

From: Mark McLoughlin <[email protected]>

With 2.6.32-rc5 in a KVM guest using dm and virtio_blk, we see the following errors:

end_request: I/O error, dev vda, sector 0
end_request: I/O error, dev vda, sector 0

The errors go away if dm stops submitting empty barriers, by reverting:

commit 52b1fd5a27c625c78373e024bf570af3c9d44a79
Author: Mikulas Patocka <[email protected]>
dm: send empty barriers to targets in dm_flush

We should silently error all barriers, even empty barriers, on devices like virtio_blk which don't support them.

See also:

https://bugzilla.redhat.com/514901

---
 block/blk-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block/blk-core.c +0 -0
index ac0fa10..71da511 100644
@@ -1161,7 +1161,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
	const unsigned int ff = bio->bi_rw & REQ_FAILFAST_MASK;
	int rw_flags;

- if (bio_rw_flagged(bio, BIO_RW_BARRIER) && bio_has_data(bio) &&
+ if (bio_rw_flagged(bio, BIO_RW_BARRIER) &&

	    (q->next_ordered == QUEUE_ORDERED_NONE)) {
		bio_endio(bio, -EOPNOTSUPP);
		return 0;