Bug 119047 - autofs fails to mount ext3 images as loop mounts
autofs fails to mount ext3 images as loop mounts
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: autofs (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeffrey Moyer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-24 05:45 EST by Nils Philippsen
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-05-10 10:32:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to use '-n' options of fsck always (not -p) (1.14 KB, patch)
2004-03-25 12:34 EST, Nils Philippsen
no flags Details | Diff
Patch to make ext2/ext3 file systems mountable again (642 bytes, patch)
2004-04-20 08:59 EDT, Nils Philippsen
no flags Details | Diff

  None (edit)
Description Nils Philippsen 2004-03-24 05:45:41 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040312

Description of problem:
When trying to access an ext3 image file on a USB flash device through
autofs (as a loopback mount), the mount fails.





Version-Release number of selected component (if applicable):
4.1.1-3

How reproducible:
Always

Steps to Reproduce:
1. Mount the USB flash disk on /mnt/flash
2. Try to access /misc/etc when the automountpoint /misc is configured
like this:

/etc/auto.misc:
[...]
etc             -fstype=ext3,loop       :/mnt/flash/etc.img
[...]


Actual Results:  nils@gibraltar:~> ls /misc/etc
ls: /misc/etc: No such file or directory


Expected Results:  ls /misc/etc lists the files contained in the ext3
image.


Additional info:

When mounting the image file manually, everything works as expected:

nils@gibraltar:~> sudo mount /mnt/flash/etc.img /mnt/tmp/ -o loop
nils@gibraltar:~> ls /mnt/tmp/
cipe  lost+found  nils

This error appears in /var/log/messages when trying to access
/misc/etc as described:

Mar 24 11:46:44 gibraltar automount[31453]: mount(ext2):
/mnt/flash/etc.img: filesystem needs repair, won't mount
Mar 24 11:46:44 gibraltar automount[31453]: failed to mount /misc/etc

Needless to say that the filesystem doesn't need repair (checked by
mounting manually and with e2fsck).
Comment 1 Jeffrey Moyer 2004-03-24 07:26:07 EST
What version of autofs are you running?
Comment 2 Nils Philippsen 2004-03-24 09:13:26 EST
Quote:

> Version-Release number of selected component (if applicable):
> 4.1.1-3

;-)
Comment 3 Nils Philippsen 2004-03-25 12:28:10 EST
From syslog:

Mar 25 18:21:21 gibraltar automount[16580]: >> e2fsck 1.35 (28-Feb-2004)
Mar 25 18:21:21 gibraltar automount[16580]: >> e2fsck: need terminal
for interactive repairs
Mar 25 18:21:21 gibraltar automount[16580]: mount(ext2):
/mnt/flash/etc.img: filesystem needs repair, won't mount
Mar 25 18:21:21 gibraltar automount[16580]: failed to mount /misc/etc

"strace -Ff -e execve -p <pid>" on the automount process gave:

[pid 16581] execve("/sbin/fsck.ext3", ["-p", "/mnt/flash/etc.img"],
[/* 13 vars */]) = 0

Apparently "e2fsck -p" isn't sufficient for totally noninteractive
fscks any more -- and since '-p -n' is allowed (according to
e2fsck(8)) I'd say that it'd be best if automount wouldn't try to
repair file systems by itself and leave that to the user (simply using
'-y' seems to dangerous to me).

Will attach a patch doing that.
Comment 4 Nils Philippsen 2004-03-25 12:34:01 EST
Created attachment 98853 [details]
patch to use '-n' options of fsck always (not -p)

Patch is not tested yet.
Comment 5 Nils Philippsen 2004-04-19 08:17:36 EDT
I have tested the patch now and automount calls "/sbin/fsck.ext3 -n
..." but e2fsck still complains about lack of terminal for interactuve
runs even though the option "-n" is specifically for non-interactively
running e2fsck... Will take a look in e2fsprogs later.
Comment 6 Nils Philippsen 2004-04-20 08:44:23 EDT
An strace on the automount process makes it a bit clearer -- it looks
like the fsck binary isn't execve()ed correctly, i.e. argv[0] isn't
set to the programs nime (e.g. "fsck.ext3") but to the option "-n"
which subsequently gets ignored, so e2fsck doesn't know the option
which would prevent it from complaining about lack of terminal:

nils@gibraltar:~> sudo strace -Ff -e execve -p 1593
Process 1593 attached - interrupt to quit
Process 24264 attached
Process 24265 attached
[pid  1593] --- SIGALRM (Alarm clock) @ 0 (0) ---
Process 1593 detached
[pid 24265] execve("/sbin/fsck.ext3", ["-n", "/mnt/flash/etc.img"],
[/* 13 vars */]) = 0
Process 24265 detached
--- SIGCHLD (Child exited) @ 0 (0) ---

I assume that the error lies somewhere in modules/mount_ext2.c or
daemon/spawn.c.
Comment 7 Nils Philippsen 2004-04-20 08:59:17 EDT
Created attachment 99559 [details]
Patch to make ext2/ext3 file systems mountable again

This patch corrects invocation of spawnl() in modules/mount_ext2.c so that
ext2/ext3 file systems can be handled by autofs again. This time, it is tested
;-).

OK to commit and build?
Comment 8 Jeffrey Moyer 2004-04-20 09:29:50 EDT
This one looks good to me.  Thanks for hunting this down and fixing it!
I'll apply the patch and build it.

-Jeff
Comment 10 Jeffrey Moyer 2004-05-05 17:44:36 EDT
I have at least one other change I'd like to get into the package
before building it into fc2.  I'll push to get this done tomorrow.

Note You need to log in before you can comment on or make changes to this bug.