brd: Refuse improperly aligned discard requests
authorJan Kara <jack@suse.com>
Wed, 4 Nov 2015 16:13:39 +0000 (17:13 +0100)
committerJens Axboe <axboe@fb.com>
Wed, 11 Nov 2015 16:36:56 +0000 (09:36 -0700)
commit2dbe5495763612f7c1b68fc897cd28c9e22079b8
tree7b53e4691b04a65e508c3dd4ea4e3cff1d53a301
parentc5a37883f42be712a989e54d5d6c0159b0e56599
brd: Refuse improperly aligned discard requests

Currently when improperly aligned discard request is submitted, we just
silently discard more / less data which results in filesystem corruption
in some cases. Refuse such misaligned requests.

Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/brd.c