linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfs: fix wrong object type in lockowner_slab
@ 2012-10-24  6:44 ycnian
  2012-10-24 19:42 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: ycnian @ 2012-10-24  6:44 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, linux-kernel, linux-fsdevel, Yanchuan Nian

From: Yanchuan Nian <ycnian@gmail.com>

The object type in the cache of lockowner_slab is wrong, and it is better to fix it.

Signed-off-by: Yanchuan Nian <ycnian@gmail.com>
---
 fs/nfsd/nfs4state.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index cc894ed..1609eb2 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2325,7 +2325,7 @@ nfsd4_init_slabs(void)
 	if (openowner_slab == NULL)
 		goto out_nomem;
 	lockowner_slab = kmem_cache_create("nfsd4_lockowners",
-			sizeof(struct nfs4_openowner), 0, 0, NULL);
+			sizeof(struct nfs4_lockowner), 0, 0, NULL);
 	if (lockowner_slab == NULL)
 		goto out_nomem;
 	file_slab = kmem_cache_create("nfsd4_files",
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nfs: fix wrong object type in lockowner_slab
  2012-10-24  6:44 [PATCH] nfs: fix wrong object type in lockowner_slab ycnian
@ 2012-10-24 19:42 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2012-10-24 19:42 UTC (permalink / raw)
  To: ycnian; +Cc: linux-nfs, linux-kernel, linux-fsdevel

On Wed, Oct 24, 2012 at 02:44:19PM +0800, ycnian@gmail.com wrote:
> From: Yanchuan Nian <ycnian@gmail.com>
> 
> The object type in the cache of lockowner_slab is wrong, and it is better to fix it.
> 
> Signed-off-by: Yanchuan Nian <ycnian@gmail.com>
> ---
>  fs/nfsd/nfs4state.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index cc894ed..1609eb2 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -2325,7 +2325,7 @@ nfsd4_init_slabs(void)
>  	if (openowner_slab == NULL)
>  		goto out_nomem;
>  	lockowner_slab = kmem_cache_create("nfsd4_lockowners",
> -			sizeof(struct nfs4_openowner), 0, 0, NULL);
> +			sizeof(struct nfs4_lockowner), 0, 0, NULL);

Thanks!

The first three fields of each are the same, the rest is:

	struct nfs4_openowner {
		...
		pointer
		time_t
		unsigned char
	}

	struct nfs4_lockowner {
		...
		struct list_head
	}

Is it always true that

	sizeof(struct nfs4_openowner) >= sizeof9struct nfs4_lockowner)

?  I think so, in which case this isn't urgent.... Applying for 3.8.

--b.

>  	if (lockowner_slab == NULL)
>  		goto out_nomem;
>  	file_slab = kmem_cache_create("nfsd4_files",
> -- 
> 1.7.4.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-24 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-24  6:44 [PATCH] nfs: fix wrong object type in lockowner_slab ycnian
2012-10-24 19:42 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).