All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/4 RFC] NFSD: Revert setting op_encode_lockowner_maxsz
@ 2014-07-07 14:13 Kinglong Mee
  2014-08-10  1:00 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Kinglong Mee @ 2014-07-07 14:13 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing List, kinglongmee

Commit 8c7424cff6 (nfsd4: don't try to encode conflicting owner if low on space)
set op_encode_lockowner_maxsz to zero.

When testing nfsd4_lock with conflict lock (has right owner), dmesg gets
  "[18668.241385] RPC request reserved 88 but used 108"
because xdr_reserve_space don't return NULL in nfsd4_encode_lock_denied.

Just revert op_encode_lockowner_maxsz.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfsd/nfs4proc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 846fd55..6217190 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1422,8 +1422,7 @@ out:
 #define op_encode_change_info_maxsz	(5)
 #define nfs4_fattr_bitmap_maxsz		(4)
 
-/* We'll fall back on returning no lockowner if run out of space: */
-#define op_encode_lockowner_maxsz	(0)
+#define op_encode_lockowner_maxsz	(1 + XDR_QUADLEN(IDMAP_NAMESZ))
 #define op_encode_lock_denied_maxsz	(8 + op_encode_lockowner_maxsz)
 
 #define nfs4_owner_maxsz		(1 + XDR_QUADLEN(IDMAP_NAMESZ))
-- 
1.9.3


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

* Re: [PATCH 3/4 RFC] NFSD: Revert setting op_encode_lockowner_maxsz
  2014-07-07 14:13 [PATCH 3/4 RFC] NFSD: Revert setting op_encode_lockowner_maxsz Kinglong Mee
@ 2014-08-10  1:00 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2014-08-10  1:00 UTC (permalink / raw)
  To: Kinglong Mee; +Cc: Linux NFS Mailing List

On Mon, Jul 07, 2014 at 10:13:18PM +0800, Kinglong Mee wrote:
> Commit 8c7424cff6 (nfsd4: don't try to encode conflicting owner if low on space)
> set op_encode_lockowner_maxsz to zero.
> 
> When testing nfsd4_lock with conflict lock (has right owner), dmesg gets
>   "[18668.241385] RPC request reserved 88 but used 108"
> because xdr_reserve_space don't return NULL in nfsd4_encode_lock_denied.
> 
> Just revert op_encode_lockowner_maxsz.

Thanks for the bug report here and apologies for the slow response, I
think this (and your more recent two patches) aren't the right fix, but
just haven't had the chance to take a closer look--I'll look at it
Monday.  We probably need to get both a minimum and maximum size for
some of these operations.

--b.

> 
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
>  fs/nfsd/nfs4proc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 846fd55..6217190 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -1422,8 +1422,7 @@ out:
>  #define op_encode_change_info_maxsz	(5)
>  #define nfs4_fattr_bitmap_maxsz		(4)
>  
> -/* We'll fall back on returning no lockowner if run out of space: */
> -#define op_encode_lockowner_maxsz	(0)
> +#define op_encode_lockowner_maxsz	(1 + XDR_QUADLEN(IDMAP_NAMESZ))
>  #define op_encode_lock_denied_maxsz	(8 + op_encode_lockowner_maxsz)
>  
>  #define nfs4_owner_maxsz		(1 + XDR_QUADLEN(IDMAP_NAMESZ))
> -- 
> 1.9.3
> 

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

end of thread, other threads:[~2014-08-10  1:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-07 14:13 [PATCH 3/4 RFC] NFSD: Revert setting op_encode_lockowner_maxsz Kinglong Mee
2014-08-10  1:00 ` J. Bruce Fields

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.