[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [Qemu-devel] [PATCH v2] nbd: Don't trim unrequested by
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-stable] [Qemu-devel] [PATCH v2] nbd: Don't trim unrequested bytes |
Date: |
Wed, 25 May 2016 14:33:35 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 25.05.2016 um 13:25 hat Eric Blake geschrieben:
> On 05/25/2016 04:59 AM, Eric Blake wrote:
> > + /* Ignore unaligned head or tail, until block layer adds byte
> > + * interface */
> > + if (request.len >= BDRV_SECTOR_SIZE) {
> > + request.len -= (request.from + request.len) % BDRV_SECTOR_SIZE;
> > + ret = blk_co_discard(exp->blk,
> > + DIV_ROUND_UP(request.from +
> > exp->dev_offset,
> > + BDRV_SECTOR_SIZE),
> > + request.len / BDRV_SECTOR_SIZE);
>
> This can end up calling blk_co_discard(, , 0) - do we need to audit
> whether all underlying drivers handle a 0-length request, and/or
> special-case this in blk_co_discard() to be an explicit no-op?
Auditing shouldn't be too hard as we don't have many drivers that
support the operation in the first place. In any case, it might be
useful to add a qemu-iotest case that tries all kinds of operations with
a zero length.
Kevin
pgp93NP9zuT0T.pgp
Description: PGP signature