Message ID | 20200401150112.9557-3-vsementsov@virtuozzo.com |
---|---|
State | New |
Headers | show |
Series | nbd: reduce max_block restrictions | expand |
On 4/1/20 10:01 AM, Vladimir Sementsov-Ogievskiy wrote: > NBD spec is updated, so that max_block doesn't relate to > NBD_CMD_TRIM. So, drop the restriction. > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> > --- > block/nbd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake <eblake@redhat.com> I might tweak the commit message of 1/6 and here to call out the NBD spec commit id (nbd.git 9f30fedb), but that doesn't change the patch proper. > > diff --git a/block/nbd.c b/block/nbd.c > index d4d518a780..4ac23c8f62 100644 > --- a/block/nbd.c > +++ b/block/nbd.c > @@ -1955,7 +1955,7 @@ static void nbd_refresh_limits(BlockDriverState *bs, Error **errp) > } > > bs->bl.request_alignment = min; > - bs->bl.max_pdiscard = max; > + bs->bl.max_pdiscard = QEMU_ALIGN_DOWN(INT_MAX, min); > bs->bl.max_pwrite_zeroes = max; > bs->bl.max_transfer = max; > >
On 4/21/20 4:56 PM, Eric Blake wrote: > On 4/1/20 10:01 AM, Vladimir Sementsov-Ogievskiy wrote: >> NBD spec is updated, so that max_block doesn't relate to >> NBD_CMD_TRIM. So, drop the restriction. >> >> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> >> --- >> block/nbd.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > Reviewed-by: Eric Blake <eblake@redhat.com> > > I might tweak the commit message of 1/6 and here to call out the NBD > spec commit id (nbd.git 9f30fedb), but that doesn't change the patch > proper. I'm queuing 1 and 2 through my NBD tree now; the rest involve more of the block layer and go in tandem with your other work on cleaning up 64-bit operations throughout, and I still need to give that a better review.
04.05.2020 22:59, Eric Blake wrote: > On 4/21/20 4:56 PM, Eric Blake wrote: >> On 4/1/20 10:01 AM, Vladimir Sementsov-Ogievskiy wrote: >>> NBD spec is updated, so that max_block doesn't relate to >>> NBD_CMD_TRIM. So, drop the restriction. >>> >>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> >>> --- >>> block/nbd.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> Reviewed-by: Eric Blake <eblake@redhat.com> >> >> I might tweak the commit message of 1/6 and here to call out the NBD spec commit id (nbd.git 9f30fedb), but that doesn't change the patch proper. > > I'm queuing 1 and 2 through my NBD tree now; the rest involve more of the block layer and go in tandem with your other work on cleaning up 64-bit operations throughout, and I still need to give that a better review. > Thank you!
diff --git a/block/nbd.c b/block/nbd.c index d4d518a780..4ac23c8f62 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1955,7 +1955,7 @@ static void nbd_refresh_limits(BlockDriverState *bs, Error **errp) } bs->bl.request_alignment = min; - bs->bl.max_pdiscard = max; + bs->bl.max_pdiscard = QEMU_ALIGN_DOWN(INT_MAX, min); bs->bl.max_pwrite_zeroes = max; bs->bl.max_transfer = max;
NBD spec is updated, so that max_block doesn't relate to NBD_CMD_TRIM. So, drop the restriction. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> --- block/nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)