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)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 9 May 2015 22:16:25 +0000 (23:16 +0100)
commit23ca6642912d2ba7ffc332774490b54d1b831ed8
tree57627cd35e6bcee3fbe9995a50cfb6b3dd5e7f38
parent361a387fabc76ca346bbcc88ba9c99ef9e7e4691
dm io: deal with wandering queue limits when handling REQ_DISCARD and REQ_WRITE_SAME

commit e5db29806b99ce2b2640d2e4d4fcb983cea115c5 upstream.

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>
[bwh: Backported to 3.2: adjust context; drop the write_same handling]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/md/dm-io.c