Hi,

i think, i've found the problem in e2fsck from e2fsprogs-1.20, which
doesn't detect the mount state correctly. e2fsck thinks filesystems
are already mounted, though they are not...

There's an additional check, which checks wether the filesystem
('file') is the root filesystem. This check succeeds and the
filesystem is marked as mounted.

Ok, here the problematic code from
e2fsprogs-1.20/lib/ext2fs/ismounted.c:check_mntent_file():

if (mnt == 0) {
        struct stat st_root, st_file;
        /*
         * Do an extra check to see if this is the root device.  We
         * can't trust /etc/fstab, and /proc/mounts will only list
         * /dev/root for the root filesystem.  Argh.  Instead we
         * check if the given device has the same major/minor number
         * as the device that the root directory is on.
         */
        if (stat("/", &st_root) == 0 && stat(file, &st_file) == 0) {
------->        if (st_root.st_dev == st_file.st_rdev) {
this
succeedes
                        *mount_flags = EXT2_MF_MOUNTED;
                        if (mtpt)
                                strncpy(mtpt, "/", mtlen);
                        goto is_root;
                }
        }
        endmntent (f);
        return 0;
}

So, is this broken code or is stat() doing something wrong?  (should
st_rdev be 0?) I'll later look more into this...

HTH, bye,
                moritz
-- 
Moritz Schulte <[EMAIL PROTECTED]> http://www.chaosdorf.de/moritz/
Debian/GNU supporter - http://www.debian.org/ http://www.gnu.org/
GPG fingerprint = 3A14 3923 15BE FD57 FC06  B501 0841 2D7B 6F98 4199

_______________________________________________
Help-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-hurd

Reply via email to