mirror of
https://github.com/torvalds/linux.git
synced 2026-07-29 18:51:21 +02:00
bcachefs: Add missing READ_ONCE() for metadata replicas
If we race with the user changing the metadata_replicas setting, this could cause us to get an incorrectly sized disk reservation. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
72b5259053
commit
8dd3804bf4
|
|
@ -1221,7 +1221,7 @@ bch2_btree_update_start(struct btree_trans *trans, struct btree_path *path,
|
|||
|
||||
ret = bch2_disk_reservation_get(c, &as->disk_res,
|
||||
(nr_nodes[0] + nr_nodes[1]) * btree_sectors(c),
|
||||
c->opts.metadata_replicas,
|
||||
READ_ONCE(c->opts.metadata_replicas),
|
||||
disk_res_flags);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user