Skip to contentSkip to conversation

ia64: fix build failure on fs/quota.c

PATCH In review Doug Chapman 2 participants 4 messages Jul 19, 2007 – Jul 26, 2007 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ia64: fix build failure on fs/quota.c

Fix ia64 build failure on fs/qutoa.c. A recent patch used the type compat_u64 which on ia64 is only available if CONFIG_COMPAT is defined.

From: Tony Luck <[email protected]>

--

fs/quota.c +1 -1
@@ -387,7 +387,7 @@ asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t
        return ret;
 }
 
-#if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
+#if defined(CONFIG_X86_64) || (defined(CONFIG_IA64) && defined(CONFIG_COMPAT))
 /*
  * This code works only for 32 bit quota tools over 64 bit OS (x86_64, ia64)
  * and is necessary due to alignment problems.
#1 lore raw
Quoted 15 lines · Doug Chapman

Fix ia64 build failure on fs/qutoa.c. A recent patch used the type compat_u64 which on ia64 is only available if CONFIG_COMPAT is defined.

From: Tony Luck <[email protected]>

--

fs/quota.c asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t · line 393

Quoted 8 lines
fs/quota.c +1 -1
@@ -387,7 +387,7 @@ asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t
        return ret;
 }
 
-#if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
+#if defined(CONFIG_X86_64) || (defined(CONFIG_IA64) && defined(CONFIG_COMPAT))
 /*
  * This code works only for 32 bit quota tools over 64 bit OS (x86_64, ia64)
  * and is necessary due to alignment problems.

I see that this patch has not been pulled in yet. I am wondering if I confused things by sending it to both linux-kernel and linux-ia64 lists and each expected the other to pull it in? Sorry if that breaks the process, I am somewhat new to submitting patches.

Can we see about getting this in? It will break the build used by fedora/RHEL for certain and I expect other distro's as well.

thanks,

- Doug

#2 lore raw

This issue wandered off onto a long thread "build fix for x86_64" which died out without a final patch. Here's the summary:

Quoted 1 line

+#if defined(CONFIG_X86_64) || (defined(CONFIG_IA64) && defined(CONFIG_COMPAT))

It was pointed out that x86-64 also has a CONFIG_COMPAT, so the "right" #ifdef mess would be:

#if defined(CONFIG_COMPAT) && (defined(CONFIG_IA64) || defined(CONFIG_X86_64))

But this was thought too ugly. Andi Kleen proposed making a new CONFIG variable for this situation: CONFIG_COMPAT_FOR_U64_ALIGMNENT which could be set in ia64 and x86-64 Kconfig files with:

config COMPAT_FOR_U64_ALIGMNENT
def_bool COMPAT

So the C-code would simply have:

#if defined(COMPAT_COMPAT_FOR_U64_ALIGMNENT)

(IIRC the syntax correctly). Peter Anvin had some worries about future issues ... but I think he agreed that this was Ok.

Anyone still have any objections to this?

arch/ia64/Kconfig +3 -0
index 36c7b96..21aa4fc 100644
@@ -425,6 +425,9 @@ config COMPAT
 	depends on IA32_SUPPORT
 	default y
 
+config COMPAT_FOR_U64_ALIGNMENT
+	def_bool COMPAT
+
 config IA64_MCA_RECOVERY
 	tristate "MCA recovery from errors other than TLB."
 
arch/x86_64/Kconfig +3 -0
index 45f82ae..ffa0364 100644
@@ -765,6 +765,9 @@ config COMPAT
 	depends on IA32_EMULATION
 	default y
 
+config COMPAT_FOR_U64_ALIGNMENT
+	def_bool COMPAT
+
 config SYSVIPC_COMPAT
 	bool
 	depends on COMPAT && SYSVIPC
fs/quota.c +1 -1
index e6577ac..99b24b5 100644
@@ -387,7 +387,7 @@ asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t
 	return ret;
 }
 
-#if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
+#if defined(CONFIG_COMPAT_FOR_U64_ALIGNMENT)
 /*
  * This code works only for 32 bit quota tools over 64 bit OS (x86_64, ia64)
  * and is necessary due to alignment problems.
#3 lore raw
Quoted 3 lines · Tony

This issue wandered off onto a long thread "build fix for x86_64" which died out without a final patch. Here's the summary:

Ahh, thanks, I had not seen that thread.

Quoted 14 lines
Quoted 1 line

+#if defined(CONFIG_X86_64) || (defined(CONFIG_IA64) && defined(CONFIG_COMPAT))

It was pointed out that x86-64 also has a CONFIG_COMPAT, so the "right" #ifdef mess would be:

#if defined(CONFIG_COMPAT) && (defined(CONFIG_IA64) || defined(CONFIG_X86_64))

But this was thought too ugly. Andi Kleen proposed making a new CONFIG variable for this situation: CONFIG_COMPAT_FOR_U64_ALIGMNENT which could be set in ia64 and x86-64 Kconfig files with:

config COMPAT_FOR_U64_ALIGMNENT
def_bool COMPAT

Quoted 8 lines

So the C-code would simply have:

#if defined(COMPAT_COMPAT_FOR_U64_ALIGMNENT)

(IIRC the syntax correctly). Peter Anvin had some worries about future issues ... but I think he agreed that this was Ok.

Anyone still have any objections to this?

No objections here. I just tried this patch and it does fix my ia64 build issue. I agree it is a bit cleaner than the long #ifdef.

thanks,

- Doug