[PATCH] AFS: Remove all AFS /proc entries in module cleanup

Andrew Morton akpm at linux-foundation.org
Thu Mar 1 02:49:58 EST 2007


On Wed, 28 Feb 2007 13:20:11 +0000 David Howells <dhowells at redhat.com> wrote:

> This is regarding a bug in the 'kafs' module. Whenever the kafs module
> is unloaded, it produces the following stack trace. 
> ********************************************************************
> kAFS: Red Hat AFS client v0.1 unregistering.
> BUG: at fs/proc/generic.c:732 remove_proc_entry()
>  [<c0195380>] remove_proc_entry+0x11b/0x175
>  [<c013b52e>] sys_delete_module+0x1a5/0x1cf
>  [<c0158bc2>] remove_vma+0x36/0x3b
>  [<c01594ca>] do_munmap+0x193/0x1ac
>  [<c0103da0>] syscall_call+0x7/0xb
>  [<c02a0033>] nf_ip_checksum+0xd4/0xe1
>  =======================
> ***************************************************************
> The problem is reproducible on the latest rc kernel - 2.6.20-rc5. The
> cause of the problem being kafs driver trying to free the /proc/fs/afs
> directory which is not empty. 
> 
> - Poornima
> 
> Signed-off-by: B N Poornima <poornima at in.ibm.com>
> Signed-Off-By: David Howells <dhowells at redhat.com>

It looks to me like this patch was actually authored by Poornima, so I'll
prepare it in that manner.  Please use a From: line right at the top of the
changelog when the authorship differs from the actual sender.

> diff --git a/fs/afs/proc.c b/fs/afs/proc.c
> index 8da8330..5b6ba12 100644
> --- a/fs/afs/proc.c
> +++ b/fs/afs/proc.c
> @@ -179,6 +179,8 @@ void afs_proc_cleanup(void)
>  	remove_proc_entry("rootcell", proc_afs);
>  	remove_proc_entry("cells", proc_afs);
>  
> +	remove_proc_entry("rootcell", proc_afs);
> +
>  	remove_proc_entry("fs/afs", NULL);
>  
>  } /* end afs_proc_cleanup() */

Your version of afs_proc_cleanup() now has two calls to
remove_proc_entry("rootcell", proc_afs); in it, but ours doesn't.

I guess that was a leftover from some development work you were doing,
but I worry whether the fix still fixes the problem in a clean tree.  Or
whether the problem really exists in a clean tree.

Please confirm that the below patch against mainline is still needed, and
that it fixes the bug, thanks.


--- a/fs/afs/proc.c~afs-remove-all-afs-proc-entries-in-module-cleanup
+++ a/fs/afs/proc.c
@@ -178,6 +178,8 @@ void afs_proc_cleanup(void)
 {
 	remove_proc_entry("cells", proc_afs);
 
+	remove_proc_entry("rootcell", proc_afs);
+
 	remove_proc_entry("fs/afs", NULL);
 
 } /* end afs_proc_cleanup() */
_




More information about the linux-afs mailing list