dm io: deal with wandering queue limits when handling REQ_DISCARD and REQ_WRITE_SAME
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 27 Feb 2015 18:44:38 +0000 (10:44 -0800)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 17 Apr 2015 00:11:46 +0000 (20:11 -0400)
commit0f4687c37c09794b8f1d701edb1372149cedd2eb
treef0724c7ec293390d80b3c3e9979011ed2fd17da8
parent28bd7dd371ff48c382905b39ef04b99472b0baa5
dm io: deal with wandering queue limits when handling REQ_DISCARD and REQ_WRITE_SAME

[ Upstream commit e5db29806b99ce2b2640d2e4d4fcb983cea115c5 ]

Since it's possible for the discard and write same queue limits to
change while the upper level command is being sliced and diced, fix up
both of them (a) to reject IO if the special command is unsupported at
the start of the function and (b) read the limits once and let the
commands error out on their own if the status happens to change.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/md/dm-io.c