drbd: fix queue limit setup for discard
authorLars Ellenberg <lars.ellenberg@linbit.com>
Tue, 24 Mar 2015 20:46:29 +0000 (21:46 +0100)
committerJens Axboe <axboe@fb.com>
Wed, 25 Nov 2015 16:22:02 +0000 (09:22 -0700)
commit088b70526d5b4080010147e4a6ae1252c3fc2228
treec985a6c1b54840b67798745308000964dcb1ab7e
parentedb5e5f63d80c368467e4a0628c5b6d30f1673eb
drbd: fix queue limit setup for discard

We cannot possibly support SECDISCARD, even if all backend devices would
support it: if our peer is currently unreachable, some instance of the
data may obviously still be recoverable.

We did not set discard_granularity at all.  We don't really care (yet),
we only pass them on, so for now, set our granularity to one sector.
blkdev_stack_limits() takes care of the rest.

If we decide we cannot support discards,
not only clear the (not user visible) QUEUE_FLAG_DISCARD,
but set both (user visible) discard_granularity and max_discard_sectors
to zero, to avoid confusion with e.g. lsblk -D.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/drbd/drbd_nl.c