diff options
| author | Al Viro <[email protected]> | 2025-05-06 19:58:26 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2025-07-21 21:53:29 +0000 |
| commit | 75764b41bfc3a463b8a5f240e93f6342510dc944 (patch) | |
| tree | 6814326e10812ffda65be20266ec5b97b1dc0cb9 /fs/btrfs/tree-log.c | |
| parent | btrfs: rename err to ret in scrub_submit_extent_sector_read() (diff) | |
| download | kernel-75764b41bfc3a463b8a5f240e93f6342510dc944.tar.gz kernel-75764b41bfc3a463b8a5f240e93f6342510dc944.zip | |
btrfs: open code fc_mount() to avoid releasing s_umount rw_sempahore
[CURRENT BEHAVIOR]
Currently inside btrfs_get_tree_subvol(), we call fc_mount() to grab a
tree, then re-lock s_umount inside btrfs_reconfigure_for_mount() to
avoid race with remount.
However fc_mount() itself is just doing two things:
1. Call vfs_get_tree()
2. Release s_umount then call vfs_create_mount()
[ENHANCEMENT]
Instead of calling fc_mount(), we can open-code it with vfs_get_tree()
first.
This provides a benefit that, since we have the full control of
s_umount, we do not need to re-lock that rw_sempahore when calling
btrfs_reconfigure_for_mount(), meaning less race between RO/RW remount.
Signed-off-by: Al Viro <[email protected]>
Reviewed-by: Qu Wenruo <[email protected]>
[ Rework the subject and commit message, refactor the error handling ]
Signed-off-by: Qu Wenruo <[email protected]>
Tested-by: Qu Wenruo <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/tree-log.c')
0 files changed, 0 insertions, 0 deletions
