We don't actually support VIRTIO_BLK_F_SEG_MAX so disable it from host
features. This fixes the following error during virtio block device probe in
the guest kernel which is caused by bogus "sg_elems" in virtblk_probe():
------------[ cut here ]------------
WARNING: at mm/page_alloc.c:1968 __alloc_pages_nodemask+0x5b4/0x6c0()
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.35-rc3 #48
Call Trace:
[<
ffffffff81081e7f>] warn_slowpath_common+0x7f/0xc0
[<
ffffffff81081eda>] warn_slowpath_null+0x1a/0x20
[<
ffffffff8110a6e4>] __alloc_pages_nodemask+0x5b4/0x6c0
[<
ffffffff8124f860>] ? idr_get_empty_slot+0x110/0x2c0
[<
ffffffff8124f860>] ? idr_get_empty_slot+0x110/0x2c0
[<
ffffffff81138795>] alloc_page_interleave+0x45/0xa0
[<
ffffffff811395d9>] alloc_pages_current+0xb9/0xe0
[<
ffffffff8110993e>] __get_free_pages+0xe/0x50
[<
ffffffff8114191e>] __kmalloc+0x14e/0x1c0
[<
ffffffff8137dbf7>] ? virtio_config_buf+0x57/0x80
[<
ffffffff81671e15>] virtblk_probe+0x78/0x498
Signed-off-by: Pekka Enberg <penberg@kernel.org>
};
static struct device device = {
- .host_features = (1UL << VIRTIO_BLK_F_SEG_MAX)
- | (1UL << VIRTIO_BLK_F_GEOMETRY)
+ .host_features = (1UL << VIRTIO_BLK_F_GEOMETRY)
| (1UL << VIRTIO_BLK_F_TOPOLOGY)
| (1UL << VIRTIO_BLK_F_BLK_SIZE),
};