[FIX] Re: umount2

From: Alexander Viro (viro@math.psu.edu)
Date: Fri Apr 14 2000 - 21:48:38 EST


On Sat, 15 Apr 2000, Mike Galbraith wrote:

> Here, any fs which ldconfig has touched ends up busy.

Not really. What actually triggered the sucker was negative dentry in the
_middle_ of lookup. IOW, cat /foo/bar/baz and you've got a leak (unless
you had both /foo and /foo/bar, that is).

Patch follows. Apply it, please. Folks, could you check whether it gets
all work done? AFAICS it should, at least in that area. Anyway, bug
is real and fix is obviously correct, so...
                                                        Cheers,
                                                                Al
diff -urN linux-2.3.99-pre6-3/fs/namei.c linux-bird.vfs/fs/namei.c
--- linux-2.3.99-pre6-3/fs/namei.c Wed Apr 12 01:39:21 2000
+++ linux-bird.vfs/fs/namei.c Fri Apr 14 22:40:11 2000
@@ -379,10 +379,10 @@
                 err = -ENOENT;
                 inode = dentry->d_inode;
                 if (!inode)
- break;
+ goto out_dput;
                 err = -ENOTDIR;
                 if (!inode->i_op)
- break;
+ goto out_dput;
 
                 if (inode->i_op->follow_link) {
                         err = do_follow_link(dentry, nd);
@@ -474,6 +474,9 @@
                 nd->last = this;
 return_base:
                 return 0;
+out_dput:
+ dput(dentry);
+ break;
         }
         dput(nd->dentry);
         mntput(nd->mnt);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:25 EST