Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"Obvious driver patch plus update to sr to add back rotational media
flag since CDROMS are rotational"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: sr: Reinstate rotational media flag
scsi: lpfc: Fix buffer free/clear order in deferred receive path

+16 -10
+6 -4
drivers/scsi/lpfc/lpfc_nvmet.c
··· 1243 1243 struct lpfc_nvmet_tgtport *tgtp; 1244 1244 struct lpfc_async_xchg_ctx *ctxp = 1245 1245 container_of(rsp, struct lpfc_async_xchg_ctx, hdlrctx.fcp_req); 1246 - struct rqb_dmabuf *nvmebuf = ctxp->rqb_buffer; 1246 + struct rqb_dmabuf *nvmebuf; 1247 1247 struct lpfc_hba *phba = ctxp->phba; 1248 1248 unsigned long iflag; 1249 1249 ··· 1251 1251 lpfc_nvmeio_data(phba, "NVMET DEFERRCV: xri x%x sz %d CPU %02x\n", 1252 1252 ctxp->oxid, ctxp->size, raw_smp_processor_id()); 1253 1253 1254 + spin_lock_irqsave(&ctxp->ctxlock, iflag); 1255 + nvmebuf = ctxp->rqb_buffer; 1254 1256 if (!nvmebuf) { 1257 + spin_unlock_irqrestore(&ctxp->ctxlock, iflag); 1255 1258 lpfc_printf_log(phba, KERN_INFO, LOG_NVME_IOERR, 1256 1259 "6425 Defer rcv: no buffer oxid x%x: " 1257 1260 "flg %x ste %x\n", 1258 1261 ctxp->oxid, ctxp->flag, ctxp->state); 1259 1262 return; 1260 1263 } 1264 + ctxp->rqb_buffer = NULL; 1265 + spin_unlock_irqrestore(&ctxp->ctxlock, iflag); 1261 1266 1262 1267 tgtp = phba->targetport->private; 1263 1268 if (tgtp) ··· 1270 1265 1271 1266 /* Free the nvmebuf since a new buffer already replaced it */ 1272 1267 nvmebuf->hrq->rqbp->rqb_free_buffer(phba, nvmebuf); 1273 - spin_lock_irqsave(&ctxp->ctxlock, iflag); 1274 - ctxp->rqb_buffer = NULL; 1275 - spin_unlock_irqrestore(&ctxp->ctxlock, iflag); 1276 1268 } 1277 1269 1278 1270 /**
+10 -6
drivers/scsi/sr.c
··· 475 475 476 476 static int sr_revalidate_disk(struct scsi_cd *cd) 477 477 { 478 + struct request_queue *q = cd->device->request_queue; 478 479 struct scsi_sense_hdr sshdr; 480 + struct queue_limits lim; 481 + int sector_size; 479 482 480 483 /* if the unit is not ready, nothing more to do */ 481 484 if (scsi_test_unit_ready(cd->device, SR_TIMEOUT, MAX_RETRIES, &sshdr)) 482 485 return 0; 483 486 sr_cd_check(&cd->cdi); 484 - return get_sectorsize(cd); 487 + sector_size = get_sectorsize(cd); 488 + 489 + lim = queue_limits_start_update(q); 490 + lim.logical_block_size = sector_size; 491 + lim.features |= BLK_FEAT_ROTATIONAL; 492 + return queue_limits_commit_update_frozen(q, &lim); 485 493 } 486 494 487 495 static int sr_block_open(struct gendisk *disk, blk_mode_t mode) ··· 729 721 730 722 static int get_sectorsize(struct scsi_cd *cd) 731 723 { 732 - struct request_queue *q = cd->device->request_queue; 733 724 static const u8 cmd[10] = { READ_CAPACITY }; 734 725 unsigned char buffer[8] = { }; 735 - struct queue_limits lim; 736 726 int err; 737 727 int sector_size; 738 728 struct scsi_failure failure_defs[] = { ··· 801 795 set_capacity(cd->disk, cd->capacity); 802 796 } 803 797 804 - lim = queue_limits_start_update(q); 805 - lim.logical_block_size = sector_size; 806 - return queue_limits_commit_update_frozen(q, &lim); 798 + return sector_size; 807 799 } 808 800 809 801 static int get_capabilities(struct scsi_cd *cd)