mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
bcachefs: Add missing smp_rmb()
The smp_rmb() guarantees that reads from reservations.counter occur before accessing cur_entry_u64s. It's paired with the atomic64_try_cmpxchg in journal_entry_open. Signed-off-by: Alan Huang <mmpgouride@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
4a4000b9a6
commit
5d361ae5af
|
|
@ -350,8 +350,10 @@ static inline int journal_res_get_fast(struct journal *j,
|
|||
|
||||
/*
|
||||
* Check if there is still room in the current journal
|
||||
* entry:
|
||||
* entry, smp_rmb() guarantees that reads from reservations.counter
|
||||
* occur before accessing cur_entry_u64s:
|
||||
*/
|
||||
smp_rmb();
|
||||
if (new.cur_entry_offset + res->u64s > j->cur_entry_u64s)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user