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:
"A couple of major (hang and deadlock) fixes with fortunately fairly
rare triggering conditions. The PM oops is only really triggered by
people using enclosure services (rare) and the fnic driver is mostly
used in enterprise environments"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
SCSI: Fix NULL pointer dereference in runtime PM
fnic: Use the local variable instead of I/O flag to acquire io_req_lock in fnic_queuecommand() to avoid deadloack

+15 -13
+1 -1
drivers/scsi/fnic/fnic.h
··· 39 39 40 40 #define DRV_NAME "fnic" 41 41 #define DRV_DESCRIPTION "Cisco FCoE HBA Driver" 42 - #define DRV_VERSION "1.6.0.17" 42 + #define DRV_VERSION "1.6.0.17a" 43 43 #define PFX DRV_NAME ": " 44 44 #define DFX DRV_NAME "%d: " 45 45
+3 -1
drivers/scsi/fnic/fnic_scsi.c
··· 425 425 unsigned long ptr; 426 426 struct fc_rport_priv *rdata; 427 427 spinlock_t *io_lock = NULL; 428 + int io_lock_acquired = 0; 428 429 429 430 if (unlikely(fnic_chk_state_flags_locked(fnic, FNIC_FLAGS_IO_BLOCKED))) 430 431 return SCSI_MLQUEUE_HOST_BUSY; ··· 519 518 spin_lock_irqsave(io_lock, flags); 520 519 521 520 /* initialize rest of io_req */ 521 + io_lock_acquired = 1; 522 522 io_req->port_id = rport->port_id; 523 523 io_req->start_time = jiffies; 524 524 CMD_STATE(sc) = FNIC_IOREQ_CMD_PENDING; ··· 573 571 (((u64)CMD_FLAGS(sc) >> 32) | CMD_STATE(sc))); 574 572 575 573 /* if only we issued IO, will we have the io lock */ 576 - if (CMD_FLAGS(sc) & FNIC_IO_INITIALIZED) 574 + if (io_lock_acquired) 577 575 spin_unlock_irqrestore(io_lock, flags); 578 576 579 577 atomic_dec(&fnic->in_flight);
+11 -11
drivers/scsi/scsi_pm.c
··· 217 217 { 218 218 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; 219 219 struct scsi_device *sdev = to_scsi_device(dev); 220 - int err; 220 + int err = 0; 221 221 222 - err = blk_pre_runtime_suspend(sdev->request_queue); 223 - if (err) 224 - return err; 225 - if (pm && pm->runtime_suspend) 222 + if (pm && pm->runtime_suspend) { 223 + err = blk_pre_runtime_suspend(sdev->request_queue); 224 + if (err) 225 + return err; 226 226 err = pm->runtime_suspend(dev); 227 - blk_post_runtime_suspend(sdev->request_queue, err); 228 - 227 + blk_post_runtime_suspend(sdev->request_queue, err); 228 + } 229 229 return err; 230 230 } 231 231 ··· 248 248 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; 249 249 int err = 0; 250 250 251 - blk_pre_runtime_resume(sdev->request_queue); 252 - if (pm && pm->runtime_resume) 251 + if (pm && pm->runtime_resume) { 252 + blk_pre_runtime_resume(sdev->request_queue); 253 253 err = pm->runtime_resume(dev); 254 - blk_post_runtime_resume(sdev->request_queue, err); 255 - 254 + blk_post_runtime_resume(sdev->request_queue, err); 255 + } 256 256 return err; 257 257 } 258 258