Re: [patch] scsi: revert "[SCSI] Get rid of scsi_cmnd->done"

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Osterlund
Date: Saturday, January 5, 2008 - 7:55 pm

Linus Torvalds <torvalds@linux-foundation.org> writes:


pktcdvd sets it when opening the /dev/pktcdvd device, but when the
drive is later opened as /dev/scd0, there is nothing that sets it
back. (Btw, 40944 is possible if the disk is a CDRW that was formatted
with "cdrwtool -m 10236".)

The problem is that pktcdvd opens the cd device in non-blocking mode
when pktsetup is run, and doesn't close it again until pktsetup -d
is run. The effect is that if you meanwhile open the cd device,
blkdev.c:do_open() doesn't call bd_set_size() because bdev->bd_openers
is non-zero.

I don't know the correct way to fix this. Maybe adding bd_set_size()
to sr.c:get_sectorsize() which already does set_capacity() would
work.


I can repeat this bug, both with and without the scsi patch that is
claimed to make a difference, both with an external USB drive and an
internal IDE drive.

To repeat:

  1. Start with an empty drive.
  2. pktsetup 0 /dev/scd0 
  3. Insert a CD containing an isofs filesystem.
  4. mount /dev/pktcdvd/0 /mnt/tmp
  5. umount /mnt/tmp
  6. Press the eject button.
  7. Insert a DVD containing a non-writable filesystem.
  8. mount /dev/scd0 /mnt/tmp
  9. find /mnt/tmp -type f -print0 | xargs -0 sha1sum >/dev/null
  10. If the DVD contains data beyond the physical size of a CD, you
      get I/O errors in the terminal, and dmesg reports lots of
      "attempt to access beyond end of device" errors.

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [patch] scsi: revert "[SCSI] Get rid of scsi_cmnd->done", Peter Osterlund, (Sat Jan 5, 7:55 pm)