[PATCH v2 0/5] Extent buffer locking and documentation

David Sterba
2019-10-30T10:56:47Z

V2:
- removed one READ_ONCE in 3/5 "btrfs: access eb::blocking_writers
according to ACCESS_ONCE policies"
- drop patch 4/5 "btrfs: serialize blocking_writers updates"
- enhance locking documentatin
- add lockdep assertions

----------------

I've spent a lot of time staring at the locking code and speculating
about all sorts of weird problems that could happen due to memory
ordering or lost wakeups or if the custom locking is safe at all, also
regarding the recent changes.

Inevitably I found something but also wrote documentation. Please read
it and if you see need for more clarifications, I'm happy to add it as
I'm now in a state that things become temporarily obvious and trivial.

I've tested it in fstests with KCSAN (the new concurrency sanitizer), no
problems found but this is not considered sufficient, more tests will
follow.

David Sterba (5):
btrfs: merge blocking_writers branches in btrfs_tree_read_lock
btrfs: set blocking_writers directly, no increment or decrement
btrfs: access eb::blocking_writers according to ACCESS_ONCE policies
btrfs: document extent buffer locking
btrfs: locking: add lock assertions

fs/btrfs/locking.c | 234 +++++++++++++++++++++++++++++++++++++--------
1 file changed, 196 insertions(+), 38 deletions(-)

--
2.23.0