Re: [PATCH] [SCSI] sr: Fix multi-drive performance by using per-device mutexes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Otto Meta wrote:
> The single mutex for the sr module, introduced as a BKL replacement,
> globally serialises all sr ioctls, which hurts multi-drive performance.
> 
> This patch replaces sr_mutex with per-device mutexes in struct scsi_cd,
> allowing concurrent ioctls on different sr devices.

Unfortunately it wasn't as easy as that. The patch seems to introduce
a race condition that corrupts a drive's state under certain circumstances.

When two drives (e.g. sr0 and sr1) are attached to the same IDE cable, one
drive has its door locked, which will usually be the case after any operation
on the drive with inserted media (and whenever it feels like it, even with
dev.cdrom.lock=0), and the other drive is unlocked, then executing

  $ eject sr0 & eject sr1

will eject the unlocked drive and the locked drive will return

  eject: unable to eject, last error: Inappropriate ioctl for device


Other drivers down the road probably don't expect concurrent ioctls, so this
patch cannot be applied safely at this time. Sorry about the noise.

For the record: Tested with kernels 3.2.35 and 3.8.0-rc1, using IDE CD/DVD
drives connected via the drivers ata_piix and pata_pdc202xx_old.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux