Home
last modified time | relevance | path

Searched hist:07741308 (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/block/
H A Drbd.c632b88ca Thu Feb 21 10:10:06 CST 2013 Alex Elder <elder@inktank.com> rbd: barriers are hard

Let's go shopping!

I'm afraid this may not have gotten it right:
07741308 rbd: add barriers near done flag operations

The smp_wmb() should have been done *before* setting the done flag,
to ensure all other data was valid before marking the object request
done.

Switch to use atomic_inc_return() here to set the done flag, which
allows us to verify we don't mark something done more than once.
Doing this also implies general barriers before and after the call.

And although a read memory barrier might have been sufficient before
reading the done flag, convert this to a full memory barrier just
to put this issue to bed.

This resolves:
http://tracker.ceph.com/issues/4238

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>

07741308 Tue Feb 05 23:41:50 CST 2013 Alex Elder <elder@inktank.com> rbd: add barriers near done flag operations

Somehow, I missed this little item in Documentation/atomic_ops.txt:
*** WARNING: atomic_read() and atomic_set() DO NOT IMPLY BARRIERS! ***

Create and use some helper functions that include the proper memory
barriers for manipulating the done field.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>