sd: Fail discard requests when logical block provisioning has been disabled
authorMartin K. Petersen <martin.petersen@oracle.com>
Tue, 22 Mar 2011 04:27:42 +0000 (00:27 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2011 16:35:53 +0000 (09:35 -0700)
Ensure that we kill discard requests after logical block provisioning
has been disabled in sysfs.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/scsi/sd.c

index 3be5db5d6343966cbbbcda26f9e12dd005f7e62b..7ff61d76b4c5de4d233353b6424ed33357b39e46 100644 (file)
@@ -597,6 +597,7 @@ static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq)
                break;
 
        default:
+               ret = BLKPREP_KILL;
                goto out;
        }