Am 05.07.2016 um 03:53 schrieb Eric Blake:
On 07/04/2016 07:49 AM, Peter Lieven wrote:
Hi,
the above commit:
commit d05aa8bb4a8b6aa9a915ec5074fb12ae632d2323
Author: Eric Blake <ebl...@redhat.com>
Date: Wed Jun 1 15:10:03 2016 -0600
block: Add .bdrv_co_pwrite_zeroes()
introduces a regression (at least for me).
The Limits from the iSCSI Block Limits VPD have no requirement of being
a power of two.
We use Dell Equallogic iSCSI SANs for instance. They have an internal
page size of 15MB. And
they advertise this page size as max_ws_len, opt_transfer_len and
opt_discard_alignment.
A non-power-of-2 max_ws_len shouldn't be a problem, but opt_transfer_len
and opt_discard_alignment not being a power of 2 impacts other code.
15MB is a rather odd page size.
I know, not my idea ;-) I think at least opt_discard_alignment of 15MB used to
work
before.
I think we cannot assert that that these alignments are a power of 2.
Perhaps that means we should just fix our code to round things down to
the nearest power of 2 (8MB) for the opt_transfer_len and
opt_discard_alignment values. Can you post a stack-trace of the actual
assertion you are hitting?
Sure:
qemu-system-x86_64: block/io.c:1165: bdrv_co_do_pwrite_zeroes: Assertion
`is_power_of_2(alignment)' failed.
Program received signal SIGABRT, Aborted.
0x00007ffff5222c37 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht
gefunden.
(gdb) bt full
#0 0x00007ffff5222c37 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
resultvar = 0
pid = 9610
selftid = 9610
#1 0x00007ffff5226028 in __GI_abort () at abort.c:89
save_stage = 2
act = {__sigaction_handler = {sa_handler = 0x7fffffffe1fe, sa_sigaction
= 0x7fffffffe1fe}, sa_mask = {__val = {140737307379972,
93824998987040, 1165, 93823560581120, 140737306023251, 0,
93825220359792, 47244640260, 93825009612448, 256, 0, 0, 0, 21474836480,
140737354027008, 140737307395000}}, sa_flags = 1438406118, sa_restorer
= 0x555555bc5ca0 <__PRETTY_FUNCTION__.34924>}
sigs = {__val = {32, 0 <repeats 15 times>}}
#2 0x00007ffff521bbf6 in __assert_fail_base (fmt=0x7ffff536c3b8 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0x555555bc55e6 "is_power_of_2(alignment)",
file=file@entry=0x555555bc5520 "block/io.c", line=line@entry=1165,
function=function@entry=0x555555bc5ca0 <__PRETTY_FUNCTION__.34924>
"bdrv_co_do_pwrite_zeroes") at assert.c:92
str = 0x5555586f5780 ""
total = 4096
#3 0x00007ffff521bca2 in __GI___assert_fail (assertion=assertion@entry=0x555555bc55e6
"is_power_of_2(alignment)",
file=file@entry=0x555555bc5520 "block/io.c", line=line@entry=1165,
function=function@entry=0x555555bc5ca0 <__PRETTY_FUNCTION__.34924>
"bdrv_co_do_pwrite_zeroes") at assert.c:101
No locals.
#4 0x0000555555a8a968 in bdrv_co_do_pwrite_zeroes (bs=bs@entry=0x5555565b2df0,
offset=offset@entry=1359998976, count=count@entry=4096,
flags=flags@entry=6) at block/io.c:1165
drv = 0x5555560b3580 <bdrv_raw>
qiov = {iov = 0x100000000, niov = 4096, nalloc = 0, size =
140737148473344}
iov = {iov_base = 0x0, iov_len = 0}
ret = 0
need_flush = false
head = 0
tail = 0
max_write_zeroes = <optimized out>
alignment = 15728640
__PRETTY_FUNCTION__ = "bdrv_co_do_pwrite_zeroes"
#5 0x0000555555a8ae3b in bdrv_aligned_pwritev (bs=bs@entry=0x5555565b2df0,
req=req@entry=0x555562ee3970, offset=offset@entry=1359998976,
bytes=bytes@entry=4096, qiov=0x555558909e58, flags=<optimized out>,
flags@entry=0) at block/io.c:1290
---Type <return> to continue, or q <return> to quit---
drv = 0x5555560b3580 <bdrv_raw>
waited = <optimized out>
ret = <optimized out>
start_sector = 2656248
end_sector = 2656256
__PRETTY_FUNCTION__ = "bdrv_aligned_pwritev"
#6 0x0000555555a8b95f in bdrv_co_pwritev (bs=0x5555565b2df0,
offset=offset@entry=1359998976, bytes=bytes@entry=4096,
qiov=qiov@entry=0x555558909e58, flags=flags@entry=0) at block/io.c:1514
req = {bs = 0x5555565b2df0, offset = 1359998976, bytes = 4096, type =
BDRV_TRACKED_WRITE, serialising = false,
overlap_offset = 1359998976, overlap_bytes = 4096, list = {le_next =
0x55555a3c9cc0, le_prev = 0x5555565b5f28}, co = 0x555557ccc100,
wait_queue = {entries = {tqh_first = 0x0, tqh_last =
0x555562ee39b8}}, waiting_for = 0x0}
align = 512
head_buf = 0x0
tail_buf = <optimized out>
local_qiov = {iov = 0x0, niov = 1448841360, nalloc = 21845, size = 0}
use_local_qiov = <optimized out>
ret = <optimized out>
__PRETTY_FUNCTION__ = "bdrv_co_pwritev"
#7 0x0000555555a7cae3 in blk_co_pwritev (blk=0x5555565b2c30,
offset=1359998976, bytes=4096, qiov=0x555558909e58, flags=0)
at block/block-backend.c:788
ret = <optimized out>
#8 0x0000555555a7cc2e in blk_aio_write_entry (opaque=0x555557da5200) at
block/block-backend.c:977
acb = 0x555557da5200
rwco = 0x555557da5228
#9 0x0000555555afafda in coroutine_trampoline (i0=<optimized out>, i1=<optimized
out>) at util/coroutine-ucontext.c:78
self = 0x555557ccc100
co = 0x555557ccc100
#10 0x00007ffff5235800 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#11 0x00007fffffffcf20 in ?? ()
No symbol table info available.
#12 0x0000000000000000 in ?? ()
No symbol table info available.
Peter