aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorDavid Sterba2019-10-11 00:03:14 +0200
committerDavid Sterba2019-11-18 17:51:50 +0100
commita4477988cfed18bdf1ad04d29b4b4a3c53269dfc (patch)
tree18072d92975f0de9f6e0418206720f0860a89339 /kernel
parent40d38f53d476238594c24c677593913695e6dec7 (diff)
btrfs: access eb::blocking_writers according to ACCESS_ONCE policies
A nice writeup of the LKMM (Linux Kernel Memory Model) rules for access once policies can be found here https://lwn.net/Articles/799218/#Access-Marking%20Policies . The locked and unlocked access to eb::blocking_writers should be annotated accordingly, following this: Writes: - locked write must use ONCE, may use plain read - unlocked write must use ONCE Reads: - unlocked read must use ONCE - locked read may use plain read iff not mixed with unlocked read - unlocked read then locked must use ONCE There's one difference on the assembly level, where btrfs_tree_read_lock_atomic and btrfs_try_tree_read_lock used the cached value and did not reevaluate it after taking the lock. This could have missed some opportunities to take the lock in case blocking writers changed between the calls, but the window is just a few instructions long. As this is in try-lock, the callers handle that. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions