]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commit
xen/blkback: don't fail empty barrier requests
authorJan Beulich <jbeulich@novell.com>
Thu, 26 May 2011 11:33:41 +0000 (12:33 +0100)
committerJan Beulich <jbeulich@novell.com>
Thu, 26 May 2011 11:33:41 +0000 (12:33 +0100)
commit723c3e82004c2d39deed694653cde534216e5e5f
tree0761539e9370935c76d957980d97fe9031371103
parentc8efeb775811e952e17b837d4bc655377221ea01
xen/blkback: don't fail empty barrier requests

The sector number on empty barrier requests may (will?) be
uninitialized (neither bio_init() nor rq_init() set the respective
fields), which allows for exceeding the actual (virtual) disk's size.

Inspired by Konrad's "When writting barriers set the sector number to
zero...", but instead of zapping the sector number (which is wrong for
non-empty ones) just ignore the sector number when the sector count is
zero.

While at it also add overflow checking to the math in vbd_translate().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
drivers/xen/blkback/vbd.c