All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Steve Dickson <SteveD@redhat.com>
Cc: Benjamin Coddington <bcodding@redhat.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v2] nfsidmap: keyctl_invalidate kernel compatibility
Date: Tue, 4 Nov 2014 15:44:56 -0500	[thread overview]
Message-ID: <46A4BDBA-C8B6-47CB-BA19-4D459944EA01@oracle.com> (raw)
In-Reply-To: <54592B0E.5050201@RedHat.com>


On Nov 4, 2014, at 2:37 PM, Steve Dickson <SteveD@redhat.com> wrote:

> 
> 
> On 11/03/2014 12:12 PM, Benjamin Coddington wrote:
>> Change the keyctl_invalidate call to use the syscall interface directly so
>> that when building with libkeyutils missing keyctl_invalidate the build succeeds.
>> Attempt to use _invalidate and fall back to _revoke if the current kernel is
>> missing _invalidate.
>> 
>> Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
> Committed... 
> 
> This does get by the nfsidmap compile error when 
> compiling on RHEL6, but not the ones in nfsdcltrack/sqlite.c
> (http://ur1.ca/ioyfs)
> 
> Chuck, how are you getting around them?

Short answer: I’m not.

The nfsdcltrack build fails after nfsidmap is built. I just
installed the nfsidmap binary for testing, and ignored the
rest of upstream nfs-utils.

Do you want me to look into this, or should Jeff do it?

> steved.
> 
>> ---
>> utils/nfsidmap/nfsidmap.c |   21 +++++++++++++++++----
>> 1 files changed, 17 insertions(+), 4 deletions(-)
>> 
>> diff --git a/utils/nfsidmap/nfsidmap.c b/utils/nfsidmap/nfsidmap.c
>> index e0d31e7..96149cc 100644
>> --- a/utils/nfsidmap/nfsidmap.c
>> +++ b/utils/nfsidmap/nfsidmap.c
>> @@ -209,10 +209,23 @@ static int key_invalidate(char *keystr, int keymask)
>> 		*(strchr(buf, ' ')) = '\0';
>> 		sscanf(buf, "%x", &key);
>> 
>> -		if (keyctl_invalidate(key) < 0) {
>> -			xlog_err("keyctl_invalidate(0x%x) failed: %m", key);
>> -			fclose(fp);
>> -			return 1;
>> +/* older libkeyutils compatibility */
>> +#ifndef KEYCTL_INVALIDATE
>> +#define KEYCTL_INVALIDATE 21      /* invalidate a key */
>> +#endif
>> +		if (keyctl(KEYCTL_INVALIDATE, key) < 0) {
>> +			if (errno != EOPNOTSUPP) {
>> +				xlog_err("keyctl_invalidate(0x%x) failed: %m", key);
>> +				fclose(fp);
>> +				return 1;
>> +			} else {
>> +				/* older kernel compatibility attempt: */
>> +				if (keyctl_revoke(key) < 0) {
>> +					xlog_err("keyctl_revoke(0x%x) failed: %m", key);
>> +					fclose(fp);
>> +					return 1;
>> +				}
>> +			}
>> 		}
>> 
>> 		keymask &= ~mask;
>> 

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




  reply	other threads:[~2014-11-04 20:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03 17:12 [PATCH v2] nfsidmap: keyctl_invalidate kernel compatibility Benjamin Coddington
2014-11-04 19:37 ` Steve Dickson
2014-11-04 20:44   ` Chuck Lever [this message]
2014-11-17 16:54     ` Chuck Lever
2014-11-17 17:11       ` Jeff Layton
2014-11-17 17:28         ` Chuck Lever
2014-11-17 17:48           ` Jeff Layton

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=46A4BDBA-C8B6-47CB-BA19-4D459944EA01@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=SteveD@redhat.com \
    --cc=bcodding@redhat.com \
    --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 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.