Fix CIFS compilation with CONFIG_KEYS unset
Subsystems (3)
PATCH 1/1 Fix CIFS compilation with CONFIG_KEYS unset
From: Rafael J. Wysocki <[email protected]>
Fix CIFS compilation with CONFIG_KEYS unset
If CONFIG_KEYS is unset, fs/cifs/sess.c doesn't build due to key_revoke() being undefined. Fix that.
--- include/linux/key.h | 1 + 1 file changed, 1 insertion(+)
include/linux/key.h +1 -0
@@ -300,6 +300,7 @@ extern void key_init(void);#define key_serial (k) 0#define key_get (k) ({ NULL; })#define key_put (k) do { } while(0) +#define key_revoke (k) do { } while(0)#define key_ref_put (k) do { } while(0)#define make_key_ref (k, p) ({ NULL; })#define key_ref_to_ptr (k) ({ NULL; })
PATCH 1/1 Fix CIFS compilation with CONFIG_KEYS unset
Rafael and Guo-Fu,
The following change to address the compile error that you noted is slightly different than what you suggested but should fix what you found.
fs/cifs/sess.c +0 -0
@@ -624,10 +624,12 @@ CIFS_SessSetup(unsigned int xid, struct
cifsSesInfo *ses, int first_time,
ses, nls_cp);
ssetup_exit:
+#ifdef CONFIG_CIFS_UPCALL
if (spnego_key) {
key_revoke(spnego_key);
key_put(spnego_key);
}
+#endif
kfree(str_area);
if (resp_buf_type == CIFS_SMALL_BUFFER) {
cFYI(1, ("ssetup freeing small buf %p", iov[0].iov_base));
---------- Forwarded message ----------
From: Rafael J. Wysocki <[email protected]>
Date: Sun, Oct 12, 2008 at 6:15 AM
Subject: [PATCH] Fix CIFS compilation with CONFIG_KEYS unset
To: Linus Torvalds <[email protected]>
Cc: Andrew Morton <[email protected]>, LKML <[email protected]>, Herbert Xu <[email protected]>, Steve French <[email protected]>
From: Rafael J. Wysocki <[email protected]>
Fix CIFS compilation with CONFIG_KEYS unset
If CONFIG_KEYS is unset, fs/cifs/sess.c doesn't build due to key_revoke() being undefined. Fix that.
--- include/linux/key.h | 1 + 1 file changed, 1 insertion(+)
include/linux/key.h +1 -0
@@ -300,6 +300,7 @@ extern void key_init(void);#define key_serial (k) 0#define key_get (k) ({ NULL; })#define key_put (k) do { } while(0) +#define key_revoke (k) do { } while(0)#define key_ref_put (k) do { } while(0)#define make_key_ref (k, p) ({ NULL; })#define key_ref_to_ptr (k) ({ NULL; })
Signature · 3 lines
Thanks, Steve
On Sun, 12 Oct 2008 08:40:39 -0500, Steve French wrote
Quoted 4 lines
Rafael and Guo-Fu,
The following change to address the compile error that you noted is slightly different than what you suggested but should fix what you found.
Thank you for the fix. :)
Guo-Fu Tseng
Quoted 5 lines · On Sun, 12 Oct 2008 08:40:39 -0500 "Steve French" <[email protected]> wrote:
Rafael and Guo-Fu,
The following change to address the compile error that you noted is slightly different than what you suggested but should fix what you found.
Actually, I like Adrian/Rafael's fix better. I think we should avoid cluttering up the code with #ifdef's where possible. key_put() already is a no-op when CONFIG_KEYS is disabled. We might as well do the same thing with key_revoke().
Cheers,
Signature · 1 line
Jeff Layton <[email protected]>
On Sun, 12 Oct 2008 09:59:03 -0400, Jeff Layton wrote
Quoted 9 lines
Quoted 5 lines · On Sun, 12 Oct 2008 08:40:39 -0500 "Steve French" <[email protected]> wrote:
Rafael and Guo-Fu,
The following change to address the compile error that you noted is slightly different than what you suggested but should fix what you found.
Quoted 4 lines
Actually, I like Adrian/Rafael's fix better. I think we should avoid cluttering up the code with #ifdef's where possible.
key_put()already is a no-op whenCONFIG_KEYSis disabled. We might as well do the same thing withkey_revoke().
I found that my patch was not reasonable at all.
And I agree with Jeff.
Guo-Fu Tseng
Quoted 9 lines · Jeff Layton
Quoted 5 lines · On Sun, 12 Oct 2008 08:40:39 -0500 "Steve French" <[email protected]> wrote:
Rafael and Guo-Fu,
The following change to address the compile error that you noted is slightly different than what you suggested but should fix what you found.
Quoted 4 lines
Actually, I like Adrian/Rafael's fix better. I think we should avoid cluttering up the code with #ifdef's where possible.
key_put()already is a no-op whenCONFIG_KEYSis disabled. We might as well do the same thing withkey_revoke().
I don't think it matters much - but we probably shouldn't be overriding global functions.
Signature · 3 lines
Thanks, Steve
Quoted 10 lines · Steve French
Quoted 7 lines · Jeff Layton
On Sun, 12 Oct 2008 08:40:39 -0500
"Steve French" <[email protected]> wrote:Actually, I like Adrian/Rafael's fix better. I think we should avoid cluttering up the code with #ifdef's where possible.
key_put()already is a no-op whenCONFIG_KEYSis disabled. We might as well do the same thing withkey_revoke().I don't think it matters much - but we probably shouldn't be overriding global functions.
To clarify, I like fixing it in keys.h better than overriding it in cifs, but in the meantime we need an ifdef in cifs until keys.h changes.
Signature · 3 lines
Thanks, Steve
Quoted 9 lines · Steve French
Quoted 8 lines · Steve French
Quoted 7 lines · Jeff Layton
On Sun, 12 Oct 2008 08:40:39 -0500
"Steve French" <[email protected]> wrote:Actually, I like Adrian/Rafael's fix better. I think we should avoid cluttering up the code with #ifdef's where possible.
key_put()already is a no-op whenCONFIG_KEYSis disabled. We might as well do the same thing withkey_revoke().
Quoted 6 lines
Quoted 2 lines
I don't think it matters much - but we probably shouldn't be overriding global functions.
To clarify, I like fixing it in
keys.hbetter than overriding it in cifs, but in the meantime we need an ifdef in cifs untilkeys.hchanges.
Well, adding an empty definition for key_revoke() in the !CONFIG_KEYS case makes sense anyway IMO.
Quoted 13 lines · Rafael J. Wysocki
Quoted 12 lines · Steve French
Quoted 10 lines · Steve French
Quoted 7 lines · Jeff Layton
On Sun, 12 Oct 2008 08:40:39 -0500
"Steve French" <[email protected]> wrote:Actually, I like Adrian/Rafael's fix better. I think we should avoid cluttering up the code with #ifdef's where possible.
key_put()already is a no-op whenCONFIG_KEYSis disabled. We might as well do the same thing withkey_revoke().I don't think it matters much - but we probably shouldn't be overriding global functions.
Quoted 6 lines
Quoted 3 lines
To clarify, I like fixing it in
keys.hbetter than overriding it in cifs, but in the meantime we need an ifdef in cifs untilkeys.hchanges.Well, adding an empty definition for
key_revoke()in the !CONFIG_KEYS case makes sense anyway IMO.
I agree. ACKED
Signature · 3 lines
Thanks, Steve
Quoted 9 lines · On Sun, 12 Oct 2008 11:57:47 -0500 "Steve French" <[email protected]> wrote:
Quoted 8 lines · Steve French
Quoted 7 lines · Jeff Layton
On Sun, 12 Oct 2008 08:40:39 -0500
"Steve French" <[email protected]> wrote:Actually, I like Adrian/Rafael's fix better. I think we should avoid cluttering up the code with #ifdef's where possible.
key_put()already is a no-op whenCONFIG_KEYSis disabled. We might as well do the same thing withkey_revoke().
Quoted 9 lines
Quoted 2 lines
I don't think it matters much - but we probably shouldn't be overriding global functions.
To clarify, I like fixing it in
keys.hbetter than overriding it in cifs, but in the meantime we need an ifdef in cifs untilkeys.hchanges.
It's your call, but if we're going to carry a temporary patch, then I'd prefer to just carry the one that adds the empty key_revoke definition. I don't think there's much benefit to changing the cifs code for this, but I don't feel very strongly about it either way...
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 6 lines · Jeff Layton
It's your call, but if we're going to carry a temporary patch, then I'd prefer to just carry the one that adds the empty
key_revokedefinition. I don't think there's much benefit to changing the cifs code for this, but I don't feel very strongly about it either way...
--
Jeff Layton <[email protected]>
There are probably various CIFS_UPCALL related ifdefs that could be merged/shrunk - let's do this as a set later.
Signature · 3 lines
Thanks, Steve