lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080814225130.GB19760@disturbed>
Date:	Fri, 15 Aug 2008 08:51:30 +1000
From:	Dave Chinner <david@...morbit.com>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:	Lachlan McIlroy <lachlan@....com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Linux Kernel Development <linux-kernel@...r.kernel.org>,
	xfs@....sgi.com, Andrew Morton <akpm@...ux-foundation.org>,
	Linux/m68k <linux-m68k@...r.kernel.org>
Subject: Re: [GIT PULL] XFS update for 2.6.27-rc4

On Thu, Aug 14, 2008 at 05:45:18PM +0200, Geert Uytterhoeven wrote:
> On Wed, 13 Aug 2008, Lachlan McIlroy wrote:
> > The following changes since commit 30a2f3c60a84092c8084dfe788b710f8d0768cd4:
> >   Linus Torvalds (1):
> >         Linux 2.6.27-rc3
> > 
> > are available in the git repository at:
> > 
> >   git://oss.sgi.com:8090/xfs/linux-2.6 master
> > 
> > David Chinner (12):
> >       [XFS] extend completions to provide XFS object flush requirements
> 
> This change (commit 39d2f1ab2a36ac527a6c41cfe689f50c239eaca3) seems to
> have broken the m68k build:
> 
> |   CC      arch/m68k/kernel/asm-offsets.s
> | In file included from linux/include/linux/mm_types.h:12,
> |                  from linux/include/linux/sched.h:61,
> |                  from linux/arch/m68k/kernel/asm-offsets.c:12:
> | linux/include/linux/completion.h: In function 'try_wait_for_completion':
> | linux/include/linux/completion.h:80: error: dereferencing pointer to incomplete type
> | linux/include/linux/completion.h: In function 'completion_done':
> | linux/include/linux/completion.h:99: error: dereferencing pointer to incomplete type
> | make[3]: *** [arch/m68k/kernel/asm-offsets.s] Error 1
> | make[2]: *** [prepare0] Error 2
> | make[1]: *** [sub-make] Error 2
> 
> (cfr. http://kisskb.ellerman.id.au/kisskb/buildresult/42080/)
> 
> Apparently there was not sufficient time between entering linux-next and
> Linus' tree to notice this breakage before, while the original patch was already
> posted on July 11...

It spent the time between then and now in the -mm tree. Seems
like nobody is building m68k out of -mm.

I'm out for the next 3 days, but it seems to me that the easiest fix
is to move that code out of the header (i.e. uninline them) so the
patch below is only compile tested on x86_64 - I've got to go load a
trailer and get moving...

Cheers,

Dave.
-- 
Dave Chinner
david@...morbit.com


Completions: Un-inline try_wait_for_completion and completion_done

m68k fails to build with these functions inlined in completion.h.
Move them out of line into sched.c and export them to avoid this
problem.

Signed-off-by: Dave Chinner <david@...morbit.com>
---
 include/linux/completion.h |   46 +------------------------------------------
 kernel/sched.c             |   46 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 44 deletions(-)

diff --git a/include/linux/completion.h b/include/linux/completion.h
index 57faa60..02ef883 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -49,6 +49,8 @@ extern unsigned long wait_for_completion_timeout(struct completion *x,
 						   unsigned long timeout);
 extern unsigned long wait_for_completion_interruptible_timeout(
 			struct completion *x, unsigned long timeout);
+extern bool try_wait_for_completion(struct completion *x);
+extern bool completion_done(struct completion *x);
 
 extern void complete(struct completion *);
 extern void complete_all(struct completion *);
@@ -56,48 +58,4 @@ extern void complete_all(struct completion *);
 #define INIT_COMPLETION(x)	((x).done = 0)
 
 
-/**
- *	try_wait_for_completion - try to decrement a completion without blocking
- *	@x:	completion structure
- *
- *	Returns: 0 if a decrement cannot be done without blocking
- *		 1 if a decrement succeeded.
- *
- *	If a completion is being used as a counting completion,
- *	attempt to decrement the counter without blocking. This
- *	enables us to avoid waiting if the resource the completion
- *	is protecting is not available.
- */
-static inline bool try_wait_for_completion(struct completion *x)
-{
-	int ret = 1;
-
-	spin_lock_irq(&x->wait.lock);
-	if (!x->done)
-		ret = 0;
-	else
-		x->done--;
-	spin_unlock_irq(&x->wait.lock);
-	return ret;
-}
-
-/**
- *	completion_done - Test to see if a completion has any waiters
- *	@x:	completion structure
- *
- *	Returns: 0 if there are waiters (wait_for_completion() in progress)
- *		 1 if there are no waiters.
- *
- */
-static inline bool completion_done(struct completion *x)
-{
-	int ret = 1;
-
-	spin_lock_irq(&x->wait.lock);
-	if (!x->done)
-		ret = 0;
-	spin_unlock_irq(&x->wait.lock);
-	return ret;
-}
-
 #endif
diff --git a/kernel/sched.c b/kernel/sched.c
index 04160d2..d3af81a 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4663,6 +4663,52 @@ int __sched wait_for_completion_killable(struct completion *x)
 }
 EXPORT_SYMBOL(wait_for_completion_killable);
 
+/**
+ *	try_wait_for_completion - try to decrement a completion without blocking
+ *	@x:	completion structure
+ *
+ *	Returns: 0 if a decrement cannot be done without blocking
+ *		 1 if a decrement succeeded.
+ *
+ *	If a completion is being used as a counting completion,
+ *	attempt to decrement the counter without blocking. This
+ *	enables us to avoid waiting if the resource the completion
+ *	is protecting is not available.
+ */
+bool try_wait_for_completion(struct completion *x)
+{
+	int ret = 1;
+
+	spin_lock_irq(&x->wait.lock);
+	if (!x->done)
+		ret = 0;
+	else
+		x->done--;
+	spin_unlock_irq(&x->wait.lock);
+	return ret;
+}
+EXPORT_SYMBOL(try_wait_for_completion);
+
+/**
+ *	completion_done - Test to see if a completion has any waiters
+ *	@x:	completion structure
+ *
+ *	Returns: 0 if there are waiters (wait_for_completion() in progress)
+ *		 1 if there are no waiters.
+ *
+ */
+bool completion_done(struct completion *x)
+{
+	int ret = 1;
+
+	spin_lock_irq(&x->wait.lock);
+	if (!x->done)
+		ret = 0;
+	spin_unlock_irq(&x->wait.lock);
+	return ret;
+}
+EXPORT_SYMBOL(completion_done);
+
 static long __sched
 sleep_on_common(wait_queue_head_t *q, int state, long timeout)
 {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ