nfsv4.1 client refuses to suspend

2013-03-21 Thread ycnian
nfsv4.1 client suspending fails with such info Freezing of tasks failed after 20.00 seconds (1 tasks refusing to freeze, wq_busy=0): nfsv4.1-svc S 88007889f2e0 0 3191 2 0x0080 88007b2f3e28 0046 88007b2f2010 000127c0 880079b08000

nfsv4.1 client refuses to suspend

2013-03-21 Thread ycnian
nfsv4.1 client suspending fails with such info Freezing of tasks failed after 20.00 seconds (1 tasks refusing to freeze, wq_busy=0): nfsv4.1-svc S 88007889f2e0 0 3191 2 0x0080 88007b2f3e28 0046 88007b2f2010 000127c0 880079b08000

[PATCH] nfsd: remove unnecessary permission checking in nfsv4

2013-03-14 Thread ycnian
From: Yanchuan Nian Since read can use stateid's from opens that only requested write access, the value returned from access_permit_read() will always be true. It's not necessary to check read permission in nfsv4. Signed-off-by: Yanchuan Nian --- fs/nfsd/nfs4state.c | 16 ++-- 1

[PATCH] nfsd: remove unnecessary permission checking in nfsv4

2013-03-14 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com Since read can use stateid's from opens that only requested write access, the value returned from access_permit_read() will always be true. It's not necessary to check read permission in nfsv4. Signed-off-by: Yanchuan Nian ycn...@gmail.com ---

[PATCH v2] nfsd: rmmove unused macro in nfsv4

2013-03-10 Thread ycnian
From: Yanchuan Nian lk_rflags is never used anywhere, and rflags is not defined in struct nfsd4_lock. Very sorry for my negligence in last version. Maybe I am tired. Signed-off-by: Yanchuan Nian --- fs/nfsd/xdr4.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git

[PATCH] nfsd: rmmove unused macro in nfsv4

2013-03-10 Thread ycnian
From: Yanchuan Nian lk_new_open_seqid is never used anywhere, and rflags is not defined in struct nfsd4_lock. Signed-off-by: Yanchuan Nian --- fs/nfsd/xdr4.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 0889bfb..326724a 100644

[PATCH v2] nfsd: fix bug on nfs4 stateid deallocation

2013-03-10 Thread ycnian
NFS4_OO_PURGE_CLOSE is not handled properly. To avoid memory leak, nfs4 stateid which is pointed by oo_last_closed_stid is freed in nfsd4_close(), but NFS4_OO_PURGE_CLOSE isn't cleared meanwhile. So the stateid released in THIS close procedure may be freed immediately in the coming encoding

[PATCH] nfsd: fix bug on nfs4 stateid deallocation

2013-03-10 Thread ycnian
NFS4_OO_PURGE_CLOSE is not handled properly. To avoid memory leak, nfs4 stateid which is pointed by oo_last_closed_stid is freed in nfsd4_close(), but NFS4_OO_PURGE_CLOSE isn't cleared meanwhile. So the stateid released in THIS close procedure may be freed immediately in the coming encoding

[PATCH] nfsd: fix bug on nfs4 stateid deallocation

2013-03-10 Thread ycnian
NFS4_OO_PURGE_CLOSE is not handled properly. To avoid memory leak, nfs4 stateid which is pointed by oo_last_closed_stid is freed in nfsd4_close(), but NFS4_OO_PURGE_CLOSE isn't cleared meanwhile. So the stateid released in THIS close procedure may be freed immediately in the coming encoding

[PATCH v2] nfsd: fix bug on nfs4 stateid deallocation

2013-03-10 Thread ycnian
NFS4_OO_PURGE_CLOSE is not handled properly. To avoid memory leak, nfs4 stateid which is pointed by oo_last_closed_stid is freed in nfsd4_close(), but NFS4_OO_PURGE_CLOSE isn't cleared meanwhile. So the stateid released in THIS close procedure may be freed immediately in the coming encoding

[PATCH] nfsd: rmmove unused macro in nfsv4

2013-03-10 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com lk_new_open_seqid is never used anywhere, and rflags is not defined in struct nfsd4_lock. Signed-off-by: Yanchuan Nian ycn...@gmail.com --- fs/nfsd/xdr4.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/fs/nfsd/xdr4.h

[PATCH v2] nfsd: rmmove unused macro in nfsv4

2013-03-10 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com lk_rflags is never used anywhere, and rflags is not defined in struct nfsd4_lock. Very sorry for my negligence in last version. Maybe I am tired. Signed-off-by: Yanchuan Nian ycn...@gmail.com --- fs/nfsd/xdr4.h |1 - 1 files changed, 0 insertions(+), 1

[PATCH] pnfs: Increase the refcount when LAYOUTGET fails the first time

2013-01-04 Thread ycnian
From: Yanchuan Nian The layout will be set unusable if LAYOUTGET fails. Is it reasonable to increase the refcount iff LAYOUTGET fails the first time? Signed-off-by: Yanchuan Nian --- fs/nfs/pnfs.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfs/pnfs.c

[PATCH] nfsd: Remove write permission from file content

2013-01-04 Thread ycnian
From: Yanchuan Nian The write function doesn't be implemented in file content, and it's meaningless to write data into this file directly. Remove write permission from it. Signed-off-by: Yanchuan Nian --- net/sunrpc/cache.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[PATCH] nfsd: Remove write permission from file content

2013-01-04 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com The write function doesn't be implemented in file content, and it's meaningless to write data into this file directly. Remove write permission from it. Signed-off-by: Yanchuan Nian ycn...@gmail.com --- net/sunrpc/cache.c |2 +- 1 files changed, 1

[PATCH] pnfs: Increase the refcount when LAYOUTGET fails the first time

2013-01-04 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com The layout will be set unusable if LAYOUTGET fails. Is it reasonable to increase the refcount iff LAYOUTGET fails the first time? Signed-off-by: Yanchuan Nian ycn...@gmail.com --- fs/nfs/pnfs.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-)

[PATCH] nfsd: Don't unlock the state while it's not locked

2012-12-24 Thread ycnian
From: Yanchuan Nian In the procedure of CREATE_SESSION, the state is locked after alloc_conn_from_crses(). If the allocation fails, the function goes to "out_free_session", and then "out" where there is an unlock function. Signed-off-by: Yanchuan Nian --- fs/nfsd/nfs4state.c |3 ++- 1

[PATCH] nfsd: Pass correct slot number to nfsd4_put_drc_mem()

2012-12-24 Thread ycnian
From: Yanchuan Nian In alloc_session(), numslots is the correct slot number used by the session. But the slot number passed to nfsd4_put_drc_mem() is the one from nfs client. Signed-off-by: Yanchuan Nian --- fs/nfsd/nfs4state.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[PATCH] nfsd: Pass correct slot number to nfsd4_put_drc_mem()

2012-12-24 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com In alloc_session(), numslots is the correct slot number used by the session. But the slot number passed to nfsd4_put_drc_mem() is the one from nfs client. Signed-off-by: Yanchuan Nian ycn...@gmail.com --- fs/nfsd/nfs4state.c |2 +- 1 files changed, 1

[PATCH] nfsd: Don't unlock the state while it's not locked

2012-12-24 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com In the procedure of CREATE_SESSION, the state is locked after alloc_conn_from_crses(). If the allocation fails, the function goes to out_free_session, and then out where there is an unlock function. Signed-off-by: Yanchuan Nian ycn...@gmail.com ---

[PATCH] nfs: Remove unused list nfs4_clientid_list

2012-12-12 Thread ycnian
From: Yanchuan Nian This list was designed to store struct nfs4_client in the client side. But nfs4_client was obsolete and has been removed from the source code. So remove the unused list. Signed-off-by: Yanchuan Nian --- fs/nfs/nfs4state.c |1 - 1 files changed, 0 insertions(+), 1

[PATCH] nfs: Remove duplicate function declaration in internal.h

2012-12-12 Thread ycnian
From: Yanchuan Nian Remove duplicate function declaration in internal.h Signed-off-by: Yanchuan Nian --- fs/nfs/internal.h |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 59b133c..440674f 100644 --- a/fs/nfs/internal.h +++

[PATCH] nfs: Don't return referenced delegations

2012-12-12 Thread ycnian
From: Yanchuan Nian The client returns unreferenced delegations in state management. It scans all delegations and tests the NFS_DELEGATION_REFERENCED flag. if this flag is not set, NFS_DELEGATION_RETURN will be set and the delegation will be returned. But unfortunately NFS_DELEGATION_REFERENCED

[PATCH] nfs: Don't return referenced delegations

2012-12-12 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com The client returns unreferenced delegations in state management. It scans all delegations and tests the NFS_DELEGATION_REFERENCED flag. if this flag is not set, NFS_DELEGATION_RETURN will be set and the delegation will be returned. But unfortunately

[PATCH] nfs: Remove duplicate function declaration in internal.h

2012-12-12 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com Remove duplicate function declaration in internal.h Signed-off-by: Yanchuan Nian ycn...@gmail.com --- fs/nfs/internal.h |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 59b133c..440674f

[PATCH] nfs: Remove unused list nfs4_clientid_list

2012-12-12 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com This list was designed to store struct nfs4_client in the client side. But nfs4_client was obsolete and has been removed from the source code. So remove the unused list. Signed-off-by: Yanchuan Nian ycn...@gmail.com --- fs/nfs/nfs4state.c |1 - 1 files

[PATCH] nfs: Fix wrong slab cache in nfs_commit_mempool

2012-11-11 Thread ycnian
From: Yanchuan Nian The slab cache in nfs_commit_mempool is wrong, and I think it is just a slip. I tested it on a x86-32 machine, the size of nfs_write_header is 544, and the size of nfs_commit_data is 408, so it works fine. It is also true that sizeof(struct nfs_write_header) > sizeof(struct

[PATCH] nfs: Fix wrong slab cache in nfs_commit_mempool

2012-11-11 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com The slab cache in nfs_commit_mempool is wrong, and I think it is just a slip. I tested it on a x86-32 machine, the size of nfs_write_header is 544, and the size of nfs_commit_data is 408, so it works fine. It is also true that sizeof(struct nfs_write_header)

[PATCH] nfs: Check whether a layout pointer is NULL before free it

2012-10-31 Thread ycnian
From: Yanchuan Nian The new layout pointer in pnfs_find_alloc_layout() may be NULL because of out of memory. we must do some check work, otherwise pnfs_free_layout_hdr() will go wrong because it can not deal with a NULL pointer. Signed-off-by: Yanchuan Nian --- fs/nfs/pnfs.c |4 ++-- 1

[PATCH] nfs: Check whether a layout pointer is NULL before free it

2012-10-31 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com The new layout pointer in pnfs_find_alloc_layout() may be NULL because of out of memory. we must do some check work, otherwise pnfs_free_layout_hdr() will go wrong because it can not deal with a NULL pointer. Signed-off-by: Yanchuan Nian ycn...@gmail.com ---

[PATCH] nfs: fix wrong object type in lockowner_slab

2012-10-24 Thread ycnian
From: Yanchuan Nian The object type in the cache of lockowner_slab is wrong, and it is better to fix it. Signed-off-by: Yanchuan Nian --- 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

[PATCH] nfs: fix wrong object type in lockowner_slab

2012-10-24 Thread ycnian
From: Yanchuan Nian ycn...@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 ycn...@gmail.com --- fs/nfsd/nfs4state.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfsd/nfs4state.c

[PATCH] NFS: Remove unnecessary semicolons (fs/nfs/client.c)

2012-09-09 Thread ycnian
From: Yanchuan Nian There are some unnecessary semicolons in function find_nfs_version. Just remove them. Signed-off-by: Yanchuan Nian --- fs/nfs/client.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 9969444..d2e1612

[PATCH] NFS: Remove unnecessary semicolons (fs/nfs/client.c)

2012-09-09 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com There are some unnecessary semicolons in function find_nfs_version. Just remove them. Signed-off-by: Yanchuan Nian ycn...@gmail.com --- fs/nfs/client.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/client.c

[PATCH][trivial]vfs: Fix a typo in fs/libfs.c

2012-09-05 Thread ycnian
From: Yanchuan Nian Just a typo in the description of function generic_fh_to_parent. Please apply. Signed-off-by: Yanchuan Nian --- fs/libfs.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/libfs.c b/fs/libfs.c index a74cb17..7cc37ca 100644 --- a/fs/libfs.c +++

[PATCH][trivial]vfs: Fix a typo in fs/libfs.c

2012-09-05 Thread ycnian
From: Yanchuan Nian ycn...@gmail.com Just a typo in the description of function generic_fh_to_parent. Please apply. Signed-off-by: Yanchuan Nian ycn...@gmail.com --- fs/libfs.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/libfs.c b/fs/libfs.c index