2002-09-17 08:09:54

by Hirokazu Takahashi

[permalink] [raw]
Subject: [BUG] [FIX] exportfs dput() problems.

Hello,

There are bugs in fs/exportfs/expfs.c to be fixed.

1) dput() might be called twice against the same dentry as local
variable "toput" in find_exported_dentry() is not cleared when
dput() is called so that following code may misunderstand that
it's still alive.

2) Some dentries might not be released in case of ENOENT error.


Thank you,
Hirokazu Takahashi.


--- linux.ORG/fs/exportfs/expfs.c Mon Sep 16 11:49:15 2030
+++ linux/fs/exportfs/expfs.c Tue Sep 17 15:54:23 2030
@@ -100,6 +100,7 @@ find_exported_dentry(struct super_block
spin_unlock(&dcache_lock);
if (toput)
dput(toput);
+ toput = NULL;
}

/* It's a directory, or we are required to confirm the file's
@@ -183,12 +184,12 @@ find_exported_dentry(struct super_block
err = CALL(nops,get_name)(ppd, nbuf, pd);
if (err) {
dput(ppd);
+ dput(pd);
if (err == -ENOENT)
/* some race between get_parent and
* get_name? just try again
*/
continue;
- dput(pd);
break;
}
dprintk("find_exported_dentry: found name: %s\n", nbuf);


-------------------------------------------------------
Sponsored by: AMD - Your access to the experts on Hammer Technology!
Open Source & Linux Developers, register now for the AMD Developer
Symposium. Code: EX8664 http://www.developwithamd.com/developerlab
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2002-09-18 05:22:13

by NeilBrown

[permalink] [raw]
Subject: Re: [BUG] [FIX] exportfs dput() problems.

On Tuesday September 17, [email protected] wrote:
> Hello,
>
> There are bugs in fs/exportfs/expfs.c to be fixed.
>
> 1) dput() might be called twice against the same dentry as local
> variable "toput" in find_exported_dentry() is not cleared when
> dput() is called so that following code may misunderstand that
> it's still alive.
>
> 2) Some dentries might not be released in case of ENOENT error.
>

Thanks for catching these to. I will forward them as appropriate.

NeilBrown


-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs