m25p80: do not put iovec on the stack
When doing a read-modify-write cycle, QEMU uses the iovec after returning from blk_aio_pwritev. m25p80 puts the iovec on the stack of blk_aio_pwritev's caller, which causes trouble in this case. This has been a problem since commit 243e6f69 ("m25p80: Switch to byte-based block access", 2016-05-12) started doing writes at a smaller granularity than 512 bytes. In principle however it could have broken before when using -drive if=mtd,cache=none on a disk with 4K native sectors. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NCédric Le Goater <clg@kaod.org> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NCédric Le Goater <clg@kaod.org> Message-id: 1467138270-32481-3-git-send-email-clg@kaod.org Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Showing
想要评论请 注册 或 登录