From: "J. Bruce Fields" <bfields@fieldses.org>
To: linux-nfs@vger.kernel.org
Subject: Re: rpc.mountd --manage-gids breaks on UID differences
Date: Fri, 27 Nov 2009 14:05:35 -0500 [thread overview]
Message-ID: <20091127190535.GA7985@fieldses.org> (raw)
In-Reply-To: <20091126091657.GL15295-N0d2glMUd7m2/GFIlvLUCQ@public.gmane.org>
On Thu, Nov 26, 2009 at 10:16:58AM +0100, Sander Smeenk wrote:
> ** Sorry for messing up the thread - My mailconfig started rejecting
> mail from vger.kernel.org for which i am eternally sorry. This message
> i'm replying to was copied from marc.info **
>
> Quoting J. Bruce Fields (bfields@fieldses.org):
>
> > > The timeframe described above matches the lines from the beginning
> > > up to 3732517.859721 in the server debug log[2]. I'd have to dig in
> > > the kernel code to find out what lines 3732513.221898 through
> > > 3732513.221913 exactly tell me.
> > > Is anyone on this list an RPC-code ninja?
> >
> > I don't think there's anything interesting in there.
> > If you do:
> >
> > date +%s >/proc/net/rpc/auth.unix.gid/flush
> > strace -e trace=read,write -s4096 -p`pidof rpc.mountd`
> >
> > then do whatever you do the client to reproduce the problem, the
> > resulting strace output might be interesting.
>
> This is the result of said strace. Server's auth.unix.gid was flushed,
> client reboots and auto-mounts the NFS-share:
>
> | [ .. ]
> | read(12, "172.17.145.222:/mnt/data/exports/application:0x00000009\n", 4096) = 56
> | write(12, "172.17.145.222:/mnt/data/exports/application:0x0000000a\n", 56) = 56
> | read(4, "0\n", 2048) = 2
> | write(4, "0 1259227707 1 0 \n", 18) = 18
>
> Again i flushed auth.unix.gid and directly accessed a file as root from
> the client:
>
> | read(4, "0\n", 2048) = 2
> | write(4, "0 1259227903 1 0 \n", 18) = 18
>
> This works as expected, file contents returned. Again i flushed
> auth.unix.gid and switched to the user with the mismatching uid on the
> server & client, accessed the exact same file directly:
>
> | read(4, "1002\n", 2048) = 5
> | write(4, "1002 1259227918 \n", 17) = -1 EINVAL (Invalid argument)
>
> These two lines repeat at a very slow interval while the client retries:
OK, thanks. Looking through the git logs.... Looks like this problem
was addressed recently in nfs-utils, by making mountd pass down a
zero-length list of gid's instead of just passing down a negative
response. The patch went in between 1.1.3 and 1.1.4.
(Arguably maybe the kernel should also be modified to interpret a
negative response as a zero-length list. I'd accept a patch.)
--b.
commit 86c3a79a108091fe08869a887438cc2d4e1126ed
Author: Neil Brown <neilb@suse.de>
Date: Wed Aug 27 16:30:19 2008 -0400
mount issue with Mac OSX and --manage-gids, client hangs
Make sure are zero len group list is sent down to the
kernel when the gids do not exist on the server.
Tested-by: Alex Samad <alex-SGFoFqf0RKf0CCvOHzKKcA@public.gmane.org>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index f555dcc..609c6e3 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -158,8 +158,10 @@ void auth_unix_gid(FILE *f)
qword_printint(f, ngroups);
for (i=0; i<ngroups; i++)
qword_printint(f, groups[i]);
- }
+ } else
+ qword_printint(f, 0);
qword_eol(f);
+
if (groups != glist)
free(groups);
}
prev parent reply other threads:[~2009-11-27 19:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-17 15:39 rpc.mountd --manage-gids breaks on UID differences Sander Smeenk
[not found] ` <20091117153928.GA12493-N0d2glMUd7m2/GFIlvLUCQ@public.gmane.org>
2009-11-17 20:08 ` J. Bruce Fields
2009-11-17 20:43 ` Sander Smeenk
2009-11-18 21:31 ` J. Bruce Fields
2009-11-26 9:16 ` Sander Smeenk
[not found] ` <20091126091657.GL15295-N0d2glMUd7m2/GFIlvLUCQ@public.gmane.org>
2009-11-27 19:05 ` J. Bruce Fields [this message]
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=20091127190535.GA7985@fieldses.org \
--to=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox