Patchwork [1/1] UBUNTU: [Upstream] block: silently error unsupported empty barriers too

login
register
mail settings
Submitter Andy Whitcroft
Date Oct. 12, 2009, 10:27 a.m.
Message ID <1255343266-9476-2-git-send-email-apw@canonical.com>
Download mbox | patch
Permalink /patch/35745/
State Accepted
Commit eabcb5a2bedd09fae7f49c799b2148382234c2e9
Headers show

Comments

Andy Whitcroft - Oct. 12, 2009, 10:27 a.m.
BugLink: http://bugs.launchpad.net/bugs/420423
Patch: http://patchwork.kernel.org/patch/39589/

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 <mpatocka@redhat.com>
    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

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 block/blk-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Stefan Bader - Oct. 12, 2009, 12:04 p.m.
Returning -EOPNOTSUPP makes sense for queues that do not support barriers 
regardless of the bio containing data or not. ACK
Stefan Bader - Oct. 12, 2009, 12:11 p.m.
Should get used to that now...

Andy Whitcroft wrote:
> BugLink: http://bugs.launchpad.net/bugs/420423
> Patch: http://patchwork.kernel.org/patch/39589/
> 
> 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 <mpatocka@redhat.com>
>     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
> 
> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: Mikulas Patocka <mpatocka@redhat.com>
> Cc: Alasdair G Kergon <agk@redhat.com>
> Cc: Neil Brown <neilb@suse.de>
> Signed-off-by: Andy Whitcroft <apw@canonical.com>

Acked-by: Stefan Bader <stefan.bader@canonical.com>

> ---
>  block/blk-core.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index e3299a7..af20cbd 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -1163,7 +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) &&
> +	if (bio_barrier(bio) &&
>  	    (q->next_ordered == QUEUE_ORDERED_NONE)) {
>  		bio_endio(bio, -EOPNOTSUPP);
>  		return 0;

Patch

diff --git a/block/blk-core.c b/block/blk-core.c
index e3299a7..af20cbd 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1163,7 +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) &&
+	if (bio_barrier(bio) &&
 	    (q->next_ordered == QUEUE_ORDERED_NONE)) {
 		bio_endio(bio, -EOPNOTSUPP);
 		return 0;