Bug 151533 - fsck tries to read directories as block devices with some bind mount setups
fsck tries to read directories as block devices with some bind mount setups
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: e2fsprogs (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Eric Sandeen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-18 17:49 EST by Peter Jones
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-20 11:19:22 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)

  None (edit)
Description Peter Jones 2005-03-18 17:49:44 EST
If I put this in my fstab:

/usr/zonk /usr/include auto bind,defaults 0 0

everything works fine.  If instead I put this:

/usr/zonk /usr/include ext3 bind,defaults 0 0

I get an error from fsck.ext3 during boot up, when we fsck everything, that says:

fsck 1.36 (05-Feb-2005)
e2fsck 1.36 (05-Feb-2005)
fsck.ext3: Is a directory while trying to open /usr/zonk

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

Mount handles this config just fine, and AFAICT "ext3" is the correct thing to
have there.
Comment 1 Stephen Tweedie 2005-03-24 11:07:07 EST
Hmm --- why is fsck calling fsck.ext3 at all for a filesystem that has "0" in
the fstab passnr field?  That certainly sounds like a fsck bug.
Comment 2 Peter Jones 2005-03-28 14:09:12 EST
Actually, I think that's an error I introduced copy the fstab entry.  It should
have been:

/usr/zonk /usr/include ext3 bind,defaults 1 3

and likewise with the "auto" one.
Comment 3 Christian Iseli 2007-01-19 19:58:02 EST
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.
Comment 4 Matthew Miller 2007-04-06 11:11:57 EDT
Fedora Core 3 and Fedora Core 4 are no longer supported. If you could retest
this issue on a current release or on the latest development / test version, we
would appreciate that. Otherwise, this bug will be marked as CANTFIX one month
from now. Thanks for your help and for your patience.
Comment 5 Eric Sandeen 2007-09-19 14:45:00 EDT
2.5 years later, yes, this still exists :D
Comment 6 Eric Sandeen 2007-09-19 16:13:17 EDT
This'll fix it, though I might ask why you've asked in your fstab for this bind
mount to be checked... :)

Index: e2fsprogs-1.40.2/misc/fsck.c
===================================================================
--- e2fsprogs-1.40.2.orig/misc/fsck.c
+++ e2fsprogs-1.40.2/misc/fsck.c
@@ -867,6 +867,12 @@ static int ignore(struct fs_info *fs)
 	if (fs->passno == 0)
 		return 1;
 
+	/*
+	 * If this is a bind mount, ignore it.
+	 */
+	if (opt_in_list("bind", fs->opts))
+		return 1;
+
 	interpret_type(fs);
 
 	/*
Comment 7 Eric Sandeen 2007-09-19 16:21:06 EDT
Sent that patch upstream.

FWIW, this could also quickly be fixed in rc.sysinit by adding "opts=nobind" to
the -t argment when fsck is invoked...

-Eric
Comment 8 Eric Sandeen 2007-09-20 11:19:22 EDT
Ok, Ted says he'll take it.  I don't think this is urgent, I'm just going to
close as UPSTREAM and we'll catch it when e2fsprogs comes around again.

If anyone has a real need for this in Fedora now, let me know.

http://marc.info/?l=linux-ext4&m=119030129702881&w=2

Will post git commit if/when it gets in (and I remember)
Comment 9 Theodore Tso 2007-09-20 15:05:48 EDT
Note, I'm going to take this while printing an error message saying that the
fstab entry is bad, since the fsck pass number really should be zero.

Also, I'm wondering about the folk who designed the fstab format for bind
mounts, as interpreted by mount.  Why not:

/dest   /src   bind    default 0 0 

or 

/dest   /src   none    bind,default 0 0

After all, when doing a bind mount, the VFS doesn't know or care about the
filesystem type of the underlying filesystem, so in some sense, an fstab line of:

/dest  /src   ext3  bind,default 0 0

... is pretty silly.   

Also, the exact format of the fstab entry for a bind mount isn't documented
either in fstab(5) or mount(8), and it really should be documented.
Comment 10 Eric Sandeen 2007-09-20 15:50:04 EDT
/dest   /src   none    bind,default 0 0

is what I'd expect.

FWIW, 

/dest   /src   foo-fs    bind,default 0 0

works too.  mount doesn't care in this case.

-Eric

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