open_namei() braindamage Re: NODEV filesystem, multiple mounts and umount...

open_namei() braindamage Re: NODEV filesystem, multiple mounts and umount...

Post by Alexander Vir » Fri, 16 Mar 2001 06:50:05




> Hey, it is reproducible:

> mount -t vfat /dev/hda1 /dos/c
> mount --bind / /xxx
> echo "a" > /xxx/dos/c

> and it stops here... ^C does not work. umount /dos/c fixes it
> (creat() returns EISDIR)

Very interesting. <thinks>
OK, so path_walk() gives us (vfsmnt of /xxx, dentry of /dos).
Then we do down() on ->i_sem of inode of /dos. OK.
We find dentry of /dos/c (mountpoint)
It's positive, so we drop ->i_sem of parent.
Dentry is a mountpoint.
We call __follow_down(). Since nothing is mounted under xxx we get
unchanged... What the *?

OK, I'm an idiot. Linus, please apply the following:

--- fs/namei.c.old    Wed Mar 14 16:37:45 2001

                error = -ELOOP;
                if (flag & O_NOFOLLOW)
                        goto exit_dput;
-               do __follow_down(&nd->mnt,&dentry); while(d_mountpoint(dentry));
+               while (__follow_down(&nd->mnt,&dentry) && d_mountpoint(dentry));
        }
        error = -ENOENT;
        if (!dentry->d_inode)

                                                        Cheers,
                                                                Al

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://www.veryComputer.com/
Please read the FAQ at  http://www.veryComputer.com/

 
 
 

1. forcing umount of NFS mounted filesystem

Machine A is stuck with an NFS partition mounted off of machine B.
I cannot umount that partition:  it always tells me that the
NFS handle is stale.  This staleness is not surprising since machine
B was "upgraded" to a different kernel that seems to use different
NFS handles.

I cannot reboot B to its old kernel and I'd rather not reboot machine A.
How can I umount that NFS partition ?

    /-0# umount /foo/bar
    umount: /foo/bar: device is busy
    /-1# umount -f /foo/bar
    umount2: Device or resource busy
    umount: /foo/bar: device is busy
    /-1# fuser /foo/bar
    /foo/bar: Stale NFS file handle
    /-1# lsof /foo/bar    
    lsof: WARNING: can't stat() nfs file system /foo/bar
          Output information may be incomplete.
    lsof: status error on /foo/bar: Stale NFS file handle
    [...]
    /-1#

Maybe I have a process still holding on to that partition, explaining
the "busy", but I can't figure out which one.  Any idea how to figure
it out without kicking out all my users ?

        Stefan

2. PPP slow also, please help

3. Can not mount/umount filesystem

4. kppp Connection Failure

5. 'nodev' Mount option under solaris2.6

6. usb / hub / usb-storage problem with 2.4.2

7. USB PenDisk mount/umount; mount: No medium found ???

8. Server & Named Pipes

9. Mounting PC's filesystem as UNIX filesystem with NFS

10. umounting big FileSystem

11. shutting down a server without umounting NFS filesystems

12. HELP: can't umount filesystem on shutdown!

13. umounting a busy filesystem