Linux NFS development
 help / color / mirror / Atom feed
From: Frank van Maarseveen <frankvm@frankvm.com>
To: Linux NFS mailing list <nfs@lists.sourceforge.net>
Subject: 2.6.21 strange optimization in svcauth_unix.c
Date: Fri, 27 Apr 2007 19:19:41 +0200	[thread overview]
Message-ID: <20070427171941.GA27920@janus> (raw)

While reading the 2.6.21 version of net/sunrpc/svcauth_unix.c it looks
to me that it tries to cache the AUTH_UNIX/AUTH_SYS group list on uid
basis and thus deliberately ignore the group ids supplied by the NFS
client. Fragment of svcauth_unix_accept():

	cred->cr_uid = svc_getnl(argv);		/* uid */
	cred->cr_gid = svc_getnl(argv);		/* gid */
	slen = svc_getnl(argv);			/* gids length */
	if (slen > 16 || (len -= (slen + 2)*4) < 0)
		goto badcred;
=>	if (unix_gid_find(cred->cr_uid, &cred->cr_group_info, rqstp)
	    == -EAGAIN)
		return SVC_DROP;
=>	if (cred->cr_group_info == NULL) {
		cred->cr_group_info = groups_alloc(slen);
		if (cred->cr_group_info == NULL)
			return SVC_DROP;
		for (i = 0; i < slen; i++)
			GROUP_AT(cred->cr_group_info, i) = svc_getnl(argv);
=>	} else {
=>		for (i = 0; i < slen ; i++)
=>			svc_getnl(argv);
=>	}

I guess this caching will break the linux NFS client patch for bypassing
the 16 groups limits maintained by me (http://www.frankvm.com/nfs-ngroups/ )
because in order to bypass the group limitation the group list is
determined dynamically at the NFS client.

Of course I can just disable the above optimization in my own patch but
I wonder what its real purpose is. I don't see a big win so is it an
optimization or is there another reason?

-- 
Frank

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

             reply	other threads:[~2007-04-27 17:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-27 17:19 Frank van Maarseveen [this message]
2007-04-28  9:27 ` 2.6.21 strange optimization in svcauth_unix.c Neil Brown
2007-04-28 10:47   ` Frank van Maarseveen

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=20070427171941.GA27920@janus \
    --to=frankvm@frankvm.com \
    --cc=nfs@lists.sourceforge.net \
    /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