Thread (20 messages) 20 messages, 7 authors, 2010-09-17

Re: [PATCH] md: do not use ++ in rcu_dereference() argument

From: Arnd Bergmann <arnd@arndb.de>
Date: 2010-09-06 20:11:14
Also in: kernel-janitors, lkml

On Sunday 05 September 2010 20:32:18 Kulikov Vasiliy wrote:
From: Vasiliy Kulikov <redacted>

rcu_dereference() is macro, so it might use its argument twice.
Argument must not has side effects.

It was found by compiler warning:
drivers/md/raid1.c: In function ‘read_balance’:
drivers/md/raid1.c:445: warning: operation on ‘new_disk’ may be undefined
I think the rcu_dereference macro should really not evaluate its argument
twice, and I don't see where it does.
As a general rule, we try to write macros in Linux such that they behave
like functions and don't have surprising side-effects.

Which kernel and gcc version do you see the warning with?

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help