mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frans Pop <elendil@planet.nl>
To: linux-ide@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Inconsistent behavior of mount for CDs
Date: Tue, 29 Apr 2008 00:08:45 +0200	[thread overview]
Message-ID: <200804290008.45665.elendil@planet.nl> (raw)

[-- Attachment #1: Type: text/plain, Size: 2014 bytes --]

Hi all,

For the Debian Installer we've been struggling with the following issue.

The CD-based installation is running (i386 using 2.6.24) mostly in memory.
The CD is mounted on /cdrom as the installer needs access to the CD.

The system being installed is mounted on /target and it too needs to install 
packages from the CD. Up till recently we've been using a bind mount for 
this, but there are some reasons we'd like to change that to mounting the 
CD itself twice.

For most installs (both in Virtualbox and on real hardware) mounting the 
same CD simultaneously on /cdrom and in the /target chroot on /media/cdrom0 
works fine, but for some installs the second mount (in the chroot) fails 
with an -EBUSY.
The issue is 100% reproducible for installs on the same system, so the 
difference seems either hardware or driver related as the installs 
themselves are basically identical. Nothing is actually accessing the CD at 
the time the second mount is being done.

AFAIK having the same CD mounted twice should normally not be a problem 
(just like a hard disk can be mounted twice). The only limitation I'd 
expect is that a CD that is still mounted at least once cannot be ejected.

Attached an strace for both a successful and an unsuccessful mount (done 
through a 'apt-cdrom add' command executed in /target chroot).
The relevant difference seems to be simply:
-25791 mount("/dev/hdc", "/media/cdrom0", "iso9660", MS_MGC_VAL|MS_NOSUID|
MS_NODEV|MS_NOEXEC, NULL) = -1 EROFS (Read-only file system)
+26735 mount("/dev/hda", "/media/cdrom0", "iso9660", MS_MGC_VAL|MS_NOSUID|
MS_NODEV|MS_NOEXEC, NULL) = -1 EBUSY (Device or resource busy)

The hardware for the 2 straces is quite different (the failing one is real 
hardware, the other is Virtualbox), but by chance they use the same IDE 
driver for the CD: piix. See also attached hw-summary files.

Any ideas what could be causing this difference in behavior?
What is the intended behavior: should one be able to mount a CD twice or 
not?

Cheers,
FJP


[-- Attachment #2: apt-cdrom_bad.strace.gz --]
[-- Type: application/x-gzip, Size: 3309 bytes --]

[-- Attachment #3: hw-summary_good.txt.gz --]
[-- Type: application/x-gzip, Size: 1016 bytes --]

[-- Attachment #4: apt-cdrom_good.strace.gz --]
[-- Type: application/x-gzip, Size: 41593 bytes --]

[-- Attachment #5: hw-summary_bad.txt.gz --]
[-- Type: application/x-gzip, Size: 1672 bytes --]

                 reply	other threads:[~2008-04-28 22:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200804290008.45665.elendil@planet.nl \
    --to=elendil@planet.nl \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®