summaryrefslogtreecommitdiff
path: root/fs/romfs
diff options
context:
space:
mode:
authorNaohiro Aota <naohiro.aota@wdc.com>2024-08-01 16:47:52 +0900
committerDavid Sterba <dsterba@suse.com>2024-08-15 20:35:56 +0200
commite30729d4bd4001881be4d1ad4332a5d4985398f8 (patch)
treefd65b63f6016619dcdb203c443d52993fea3aac2 /fs/romfs
parent008e2512dc5696ab2dc5bf264e98a9fe9ceb830e (diff)
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: stable@vger.kernel.org # 5.15+ Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/romfs')
0 files changed, 0 insertions, 0 deletions