Re: [Confirmed, cause found] Re: BUG in rmdir changes

H.J. Lu (hjl@lucon.org)
Fri, 11 Dec 1998 09:48:56 -0800 (PST)


>
> WHAT? All changes in rmdir are far off from the path demonstarted here.
> do_rmdir() has been changed, but all changes are below the test for
> negative dentry. It shouldn't even get to the code in quest... Wait.
> static inline int do_rmdir(const char * name)
> {
> int error;
> struct dentry *dir;
> struct dentry *dentry;
>
> dentry = lookup_dentry(name, NULL, 0);
> error = PTR_ERR(dentry);
> if (IS_ERR(dentry))
> goto exit;
>
> dir = dget(dentry->d_parent);
>
> error = -ENOENT;
> if (!dentry->d_inode)
> goto exit;
>
> Arrgh!!! OK, I've got it. Sheesh... dget() should happen immediately
> after the check for negative dentry.
>
> Looks like we've caught it - fix being to move the line with dget()
> immediately below the check. I'll roll the patch as soon as I'll get to
> the Linux box where I have an official tree.
> Al

After this patch, my floppy umount problem still remains.

-- 
H.J. Lu (hjl@gnu.org)
---
Index: namei.c
===================================================================
RCS file: /home/work/cvs/linux/linux/fs/namei.c,v
retrieving revision 1.1.1.27
diff -u -r1.1.1.27 namei.c
--- namei.c	1998/12/03 22:03:14	1.1.1.27
+++ namei.c	1998/12/11 17:48:21
@@ -876,11 +876,12 @@
 	if (IS_ERR(dentry))
 		goto exit;
 
-	dir = dget(dentry->d_parent);
-
 	error = -ENOENT;
 	if (!dentry->d_inode)
 		goto exit;
+
+	dir = dget(dentry->d_parent);
+
 	/*
 	 * The dentry->d_count stuff confuses d_delete() enough to
 	 * not kill the inode from under us while it is locked. This

- 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/