Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208317
b: refs/heads/master
c: 6a32a8a
h: refs/heads/master
i:
  208315: 2da3e33
v: v3
  • Loading branch information
FUJITA Tomonori authored and Jens Axboe committed Aug 7, 2010
1 parent 632d94b commit 97a7878
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8112586063fe53958d60218631d661533f304504
refs/heads/master: 6a32a8aed509e71137043d464db4a7fcd88c903e
7 changes: 6 additions & 1 deletion trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq)
nr_sectors >>= 3;
}

rq->cmd_type = REQ_TYPE_BLOCK_PC;
rq->timeout = SD_TIMEOUT;

memset(rq->cmd, 0, rq->cmd_len);
Expand Down Expand Up @@ -1200,6 +1199,12 @@ static int sd_done(struct scsi_cmnd *SCpnt)
int sense_valid = 0;
int sense_deferred = 0;

if (SCpnt->request->cmd_flags & REQ_DISCARD) {
if (!result)
scsi_set_resid(SCpnt, 0);
return good_bytes;
}

if (result) {
sense_valid = scsi_command_normalize_sense(SCpnt, &sshdr);
if (sense_valid)
Expand Down

0 comments on commit 97a7878

Please sign in to comment.