kernel/smp.c: use '|=' for csd_lock
authorliguang <lig.fnst@cn.fujitsu.com>
Tue, 30 Apr 2013 22:27:25 +0000 (15:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 May 2013 00:04:02 +0000 (17:04 -0700)
csd_lock() uses assignment to data->flags rather than |=.  That is not
buggy at present because only one bit (CSD_FLAG_LOCK) is defined in
call_single_data.flags.

But it will become buggy if we later add another flag, so fix it now.

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/smp.c

index 8e451f3ff51b818796bf5ca4e4b3189a215b367a..b320622543e901741eda59d636ed812b4329d60a 100644 (file)
@@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data)
 static void csd_lock(struct call_single_data *data)
 {
        csd_lock_wait(data);
-       data->flags = CSD_FLAG_LOCK;
+       data->flags |= CSD_FLAG_LOCK;
 
        /*
         * prevent CPU from reordering the above assignment