From: Jie Liu Date: Wed, 20 Nov 2013 08:08:53 +0000 (+0800) Subject: xfs: don't perform discard if the given range length is less than block size X-Git-Tag: v3.14-rc1~123^2~29 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9fd0135610084abef6867d984e9951c3099950d;p=pandora-kernel.git xfs: don't perform discard if the given range length is less than block size For discard operation, we should return EINVAL if the given range length is less than a block size, otherwise it will go through the file system to discard data blocks as the end range might be evaluated to -1, e.g, # fstrim -v -o 0 -l 100 /xfs7 /xfs7: 9811378176 bytes were trimmed This issue can be triggered via xfstests/generic/288. Also, it seems to get the request queue pointer via bdev_get_queue() instead of the hard code pointer dereference is not a bad thing. Signed-off-by: Jie Liu Reviewed-by: Christoph Hellwig Signed-off-by: Ben Myers --- Reading git-diff-tree failed