Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115464
b: refs/heads/master
c: bd623e7
h: refs/heads/master
v: v3
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Oct 13, 2008
1 parent 2705848 commit eea6528
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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: c82dc88ddaf17112841dd3a6b08352968555ee08
refs/heads/master: bd623e79fb6bca7ab685bb1f7376476a81ce10bb
7 changes: 4 additions & 3 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
sector_t block = rq->sector;
sector_t threshold;
unsigned int this_count = rq->nr_sectors;
int ret;
int ret, host_dif;

if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
ret = scsi_setup_blk_pc_cmnd(sdp, rq);
Expand Down Expand Up @@ -515,7 +515,8 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
rq->nr_sectors));

/* Set RDPROTECT/WRPROTECT if disk is formatted with DIF */
if (scsi_host_dif_capable(sdp->host, sdkp->protection_type))
host_dif = scsi_host_dif_capable(sdp->host, sdkp->protection_type);
if (host_dif)
SCpnt->cmnd[1] = 1 << 5;
else
SCpnt->cmnd[1] = 0;
Expand Down Expand Up @@ -573,7 +574,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
SCpnt->sdb.length = this_count * sdp->sector_size;

/* If DIF or DIX is enabled, tell HBA how to handle request */
if (sdkp->protection_type || scsi_prot_sg_count(SCpnt))
if (host_dif || scsi_prot_sg_count(SCpnt))
sd_dif_op(SCpnt, sdkp->protection_type, scsi_prot_sg_count(SCpnt));

/*
Expand Down

0 comments on commit eea6528

Please sign in to comment.