sd: Fail discard requests when logical block provisioning has been disabled
Martin K. Petersen [Tue, 22 Mar 2011 04:27:42 +0000 (00:27 -0400)]
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 3be5db5..7ff61d7 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;
        }