Commit Graph

5 Commits

Author SHA1 Message Date
Karel Zak f314a6becc fdisk: (and partx) remove BLKGETLASTSECT
This odd ioctl is unsupported in the current 2.4 and 2.6 mainline.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-26 23:03:46 +01:00
Matthias Koenig d50c5917f0 mount: retry on ENOMEDIUM
Due to a change in kernel behaviour when opening CDROM devices,
we need to retry the open/mount call when ENOMEDIUM is returned.

Explanation from Tejun Heo:
Okay, the difference is from the addition of cdrom_get_media_event()
call to both sr_drive_status() and ide_cdrom_drive_status().
Previously, the cdrom driver can't differentiate between tray closed
w/ no media and tray open and always returned tray open, which
triggers close and retry in the open logic which probably have delayed
things enough to get the media recognized.

Now the cdrom driver can discern between tray closed w/o media and
device not ready for other reasons and returns -ENOMEDIUM on the
former.  This is all good and dandy but the problem seems that some
drives report no media right after the tray is closed but it hasn't
properly detected the media yet.

It seems the only way to work around the problem is via sensible
retries (e.g.  try three times 5 secs apart) and I don't think we can
add that type of retry logic into cdrom open path.  Please note that
the previous logic wasn't water proof.  Some drives can take longer to
recognize the media is there and could have failed the in-kernel retry
too.  Also, reading the media can take quite some time and during that
period the drive reports media present but device not ready.  The
driver will retry the command (e.g. READ TOC for open) five times but
all of them can fail w/ EMEDIUMTYPE.

[kzak@redhat.com: - add CRDOM_NOMEDIUM_RETRIES to blkdev.h
                  - add verbose message to mount.c]

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-30 13:21:14 +02:00
Samuel Thibault 268cefe6cb lib: blkdev.c clean up, non-linux support
[kzak@redhat.com: split the original patch to small patches]

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-24 00:52:52 +02:00
Karel Zak 8505ff35cf elvtune: use get_linux_version()
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-07 21:25:48 +01:00
Stefan Krah 3738a48e08 lib: add blkdev.{c,h}
Now we duplicate BLK* ioctls on many places... This patch also
fix BLKGETSIZE64 usage in dependence on kernel version.

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Stefan Krah <stefan@bytereef.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-07 12:37:30 +01:00