Bug 151533 - fsck tries to read directories as block devices with some bind mount setups
Summary: fsck tries to read directories as block devices with some bind mount setups
Alias: None
Product: Fedora
Classification: Fedora
Component: e2fsprogs
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Eric Sandeen
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-03-18 22:49 UTC by Peter Jones
Modified: 2007-11-30 22:11 UTC (History)
3 users (show)

Clone Of:
Last Closed: 2007-09-20 15:19:22 UTC

Attachments (Terms of Use)

Description Peter Jones 2005-03-18 22:49:44 UTC
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 16:07:07 UTC
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 19:09:12 UTC
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-20 00:58:02 UTC
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 ?


Comment 4 Matthew Miller 2007-04-06 15:11:57 UTC
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 18:45:00 UTC
2.5 years later, yes, this still exists :D

Comment 6 Eric Sandeen 2007-09-19 20:13:17 UTC
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;

Comment 7 Eric Sandeen 2007-09-19 20:21:06 UTC
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...


Comment 8 Eric Sandeen 2007-09-20 15:19:22 UTC
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.


Will post git commit if/when it gets in (and I remember)

Comment 9 Theodore Tso 2007-09-20 19:05:48 UTC
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 


/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 19:50:04 UTC
/dest   /src   none    bind,default 0 0

is what I'd expect.


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

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


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