Skip to contentSkip to conversation

nfs: fix wrong object type in lockowner_slab

PATCH In review [email protected] 2 participants 2 messages Oct 24, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs: fix wrong object type in lockowner_slab

From: Yanchuan Nian <[email protected]>

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

---
 fs/nfsd/nfs4state.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs4state.c +1 -1
index cc894ed..1609eb2 100644
@@ -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",
Signature · 1 line
1.7.4.4
#1 lore raw
Quoted 14 lines · On Wed, Oct 24, 2012 at 02:44:19PM +0800, [email protected] wrote:

From: Yanchuan Nian <[email protected]>

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

---
 fs/nfsd/nfs4state.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs4state.c +0 -0
index cc894ed..1609eb2 100644

fs/nfsd/nfs4state.c nfsd4_init_slabs(void) · line 2328

Quoted 5 lines
fs/nfsd/nfs4state.c +1 -1
@@ -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.

Quoted 6 lines
fs/nfsd/nfs4state.c +0 -0
 	if (lockowner_slab == NULL)
 		goto out_nomem;
 	file_slab = kmem_cache_create("nfsd4_files",
Signature · 1 line
1.7.4.4