diff options
| author | Naohiro Aota <[email protected]> | 2024-08-01 07:47:52 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2024-08-15 18:35:56 +0000 |
| commit | e30729d4bd4001881be4d1ad4332a5d4985398f8 (patch) | |
| tree | fd65b63f6016619dcdb203c443d52993fea3aac2 /drivers/platform/x86/intel/pmt/class.c | |
| parent | btrfs: tree-checker: add dev extent item checks (diff) | |
| download | kernel-e30729d4bd4001881be4d1ad4332a5d4985398f8.tar.gz kernel-e30729d4bd4001881be4d1ad4332a5d4985398f8.zip | |
btrfs: zoned: properly take lock to read/update block group's zoned variables
__btrfs_add_free_space_zoned() references and modifies bg's alloc_offset,
ro, and zone_unusable, but without taking the lock. It is mostly safe
because they monotonically increase (at least for now) and this function is
mostly called by a transaction commit, which is serialized by itself.
Still, taking the lock is a safer and correct option and I'm going to add a
change to reset zone_unusable while a block group is still alive. So, add
locking around the operations.
Fixes: 169e0da91a21 ("btrfs: zoned: track unusable bytes for zones")
CC: [email protected] # 5.15+
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Naohiro Aota <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'drivers/platform/x86/intel/pmt/class.c')
0 files changed, 0 insertions, 0 deletions
