All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suresh Jayaraman <sjayaraman@suse.de>
To: hooanon05-/E1597aS9LR3+QwDJ9on6Q@public.gmane.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	" " <jamagallon-sh/6fXdz2Rs@public.gmane.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-nfs@vger.kernel.org, Trond.Myklebust@netapp.com,
	lists@fuchsschwanzdomain.de
Subject: Re: Problems with default ACLs over NFS
Date: Mon, 20 Apr 2009 10:12:00 +0530	[thread overview]
Message-ID: <49EBFD18.4070607@suse.de> (raw)
In-Reply-To: <18513.1238194255@jrobl>

hooanon05-/E1597aS9LR3+QwDJ9on6Q@public.gmane.org wrote:
>> On Mon, 23 Mar 2009 22:24:27 +0100 "J.A. Magall__n" <jamagallon-sh/6fXdz2Rs@public.gmane.org> wrote:
>>
>>> Hi all...
>>>
>>> I have a strange problem with 2.6.29-rc8-git3.
>>> It looks like a kernel bug... ?
>>>
>>> I have a box with NFS autofs-mounted home directories. Server is a
>>> Solaris 10 system. This worked in previous kernel versions, so I
>>> don't blame Solaris, at this moment.
>>>
>>> With this acls set in my home:
> 	:::
>>> I get this strange message in the linux client:
>>>
>>> cicely:~> mkdir kk  
>>> mkdir: cannot create directory `kk': Invalid argument

The following patch from Trond should fix this issue, I think.


From: Trond Myklebust <Trond.Myklebust@netapp.com>
Date: Wed, 15 Apr 2009 13:58:45 -0400
Subject: [PATCH] NFS: Fix the XDR iovec calculation in nfs3_xdr_setaclargs

Commit ae46141ff08f1965b17c531b571953c39ce8b9e2 (NFSv3: Fix posix ACL code)
introduces a bug in the calculation of the XDR header iovec. In the case
where we are inlining the acls, we need to adjust the length of the iovec
req->rq_svec, in addition to adjusting the total buffer length.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
 fs/nfs/nfs3xdr.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index e6a1932..35869a4 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -713,7 +713,8 @@ nfs3_xdr_setaclargs(struct rpc_rqst *req, __be32 *p,
 	if (args->npages != 0)
 		xdr_encode_pages(buf, args->pages, 0, args->len);
 	else
-		req->rq_slen += args->len;
+		req->rq_slen = xdr_adjust_iovec(req->rq_svec,
+				p + XDR_QUADLEN(args->len));
 
 	err = nfsacl_encode(buf, base, args->inode,
 			    (args->mask & NFS_ACL) ?



> Tracing some kernel functions, I observed several thigs.
> - xdr_buf_subsegment() returned -1 due to 'len' is not 0.
> - xdr_encode_word() call from nfsacl_encode() got this -1, and
>   nfsacl_encode/nfs3_xdr_setaclargs/nfs3_proc_setacls/nfs3_proc_setacl/nfs3_setxattr
>   returned -EINVAL.
> 
> 
> Finally I am afraid this commit might be related to this issue.
> 
> commit ae46141ff08f1965b17c531b571953c39ce8b9e2
> Author: Trond Myklebust <Trond.Myklebust@netapp.com>
> Date:   Tue Mar 10 20:33:18 2009 -0400
> 
>     NFSv3: Fix posix ACL code
>     
>     Fix a memory leak due to allocation in the XDR layer. In cases where the
>     RPC call needs to be retransmitted, we end up allocating new pages without
>     clearing the old ones. Fix this by moving the allocation into
>     nfs3_proc_setacls().
>     
>     Also fix an issue discovered by Kevin Rudd, whereby the amount of memory
>     reserved for the acls in the xdr_buf->head was miscalculated, and causing
>     corruption.
> 
> 
> 
> J. R. Okajima
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Suresh Jayaraman

WARNING: multiple messages have this Message-ID (diff)
From: Suresh Jayaraman <sjayaraman@suse.de>
To: hooanon05@yahoo.co.jp
Cc: Andrew Morton <akpm@linux-foundation.org>,
	" " <jamagallon@ono.com>, LKML <linux-kernel@vger.kernel.org>,
	linux-nfs@vger.kernel.org, Trond.Myklebust@netapp.com,
	lists@fuchsschwanzdomain.de
Subject: Re: Problems with default ACLs over NFS
Date: Mon, 20 Apr 2009 10:12:00 +0530	[thread overview]
Message-ID: <49EBFD18.4070607@suse.de> (raw)
In-Reply-To: <18513.1238194255@jrobl>

hooanon05@yahoo.co.jp wrote:
>> On Mon, 23 Mar 2009 22:24:27 +0100 "J.A. Magall__n" <jamagallon@ono.com> wrote:
>>
>>> Hi all...
>>>
>>> I have a strange problem with 2.6.29-rc8-git3.
>>> It looks like a kernel bug... ?
>>>
>>> I have a box with NFS autofs-mounted home directories. Server is a
>>> Solaris 10 system. This worked in previous kernel versions, so I
>>> don't blame Solaris, at this moment.
>>>
>>> With this acls set in my home:
> 	:::
>>> I get this strange message in the linux client:
>>>
>>> cicely:~> mkdir kk  
>>> mkdir: cannot create directory `kk': Invalid argument

The following patch from Trond should fix this issue, I think.


From: Trond Myklebust <Trond.Myklebust@netapp.com>
Date: Wed, 15 Apr 2009 13:58:45 -0400
Subject: [PATCH] NFS: Fix the XDR iovec calculation in nfs3_xdr_setaclargs

Commit ae46141ff08f1965b17c531b571953c39ce8b9e2 (NFSv3: Fix posix ACL code)
introduces a bug in the calculation of the XDR header iovec. In the case
where we are inlining the acls, we need to adjust the length of the iovec
req->rq_svec, in addition to adjusting the total buffer length.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
 fs/nfs/nfs3xdr.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index e6a1932..35869a4 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -713,7 +713,8 @@ nfs3_xdr_setaclargs(struct rpc_rqst *req, __be32 *p,
 	if (args->npages != 0)
 		xdr_encode_pages(buf, args->pages, 0, args->len);
 	else
-		req->rq_slen += args->len;
+		req->rq_slen = xdr_adjust_iovec(req->rq_svec,
+				p + XDR_QUADLEN(args->len));
 
 	err = nfsacl_encode(buf, base, args->inode,
 			    (args->mask & NFS_ACL) ?



> Tracing some kernel functions, I observed several thigs.
> - xdr_buf_subsegment() returned -1 due to 'len' is not 0.
> - xdr_encode_word() call from nfsacl_encode() got this -1, and
>   nfsacl_encode/nfs3_xdr_setaclargs/nfs3_proc_setacls/nfs3_proc_setacl/nfs3_setxattr
>   returned -EINVAL.
> 
> 
> Finally I am afraid this commit might be related to this issue.
> 
> commit ae46141ff08f1965b17c531b571953c39ce8b9e2
> Author: Trond Myklebust <Trond.Myklebust@netapp.com>
> Date:   Tue Mar 10 20:33:18 2009 -0400
> 
>     NFSv3: Fix posix ACL code
>     
>     Fix a memory leak due to allocation in the XDR layer. In cases where the
>     RPC call needs to be retransmitted, we end up allocating new pages without
>     clearing the old ones. Fix this by moving the allocation into
>     nfs3_proc_setacls().
>     
>     Also fix an issue discovered by Kevin Rudd, whereby the amount of memory
>     reserved for the acls in the xdr_buf->head was miscalculated, and causing
>     corruption.
> 
> 
> 
> J. R. Okajima
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Suresh Jayaraman

  reply	other threads:[~2009-04-20  4:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-23 21:24 Problems with default ACLs over NFS J.A. Magallón
     [not found] ` <20090323222427.00bb24e7-BIo4oXGMtDgJmsy6czSMtA@public.gmane.org>
2009-03-27  0:05   ` Andrew Morton
2009-03-27  0:05     ` Andrew Morton
2009-03-27 22:50     ` hooanon05
2009-04-20  4:42       ` Suresh Jayaraman [this message]
2009-04-20  4:42         ` Suresh Jayaraman
2009-04-20  5:17         ` hooanon05
2009-04-20  5:35           ` Suresh Jayaraman
2009-04-20  5:35             ` Suresh Jayaraman
2009-04-20 14:18             ` Sven Geggus
2009-04-21  5:00               ` Suresh Jayaraman
  -- strict thread matches above, loose matches on Subject: below --
2009-04-19 15:03 Sven Geggus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49EBFD18.4070607@suse.de \
    --to=sjayaraman@suse.de \
    --cc=Trond.Myklebust@netapp.com \
    --cc=akpm@linux-foundation.org \
    --cc=hooanon05-/E1597aS9LR3+QwDJ9on6Q@public.gmane.org \
    --cc=jamagallon-sh/6fXdz2Rs@public.gmane.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=lists@fuchsschwanzdomain.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.