nbd: set discard_alignment to the granularity
authorJosef Bacik <josef@toxicpanda.com>
Tue, 5 Jun 2018 15:41:23 +0000 (11:41 -0400)
committerJens Axboe <axboe@kernel.dk>
Tue, 5 Jun 2018 15:50:46 +0000 (09:50 -0600)
commit07ce213f63fbc389c8fcaefab6267b3bc0a12796
treea3670201907277e6305c3a93932c5f02182ff05b
parentee57a05cf86f9789cbac5e9de8e720458338533b
nbd: set discard_alignment to the granularity

Technically we should be able to get away with 0 as the
discard_alignment, but there's no way currently for the protocol to
indicate different alignments, and in real life most disks have
discard_alignment == discard_granularity.  Just set our alignment to our
blocksize to make sure discards will actually work properly with 4k
drives.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c