diff options
| author | Josef Bacik <[email protected]> | 2021-10-05 16:12:41 -0400 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2021-10-26 19:08:07 +0200 |
| commit | 8b41393fe7c3b180abadc26856fb653014733bb9 (patch) | |
| tree | d9c63ffcdd0109adffa37db7d0df4b4eb41b743c /lib/test_fortify/write_overflow-strlcpy.c | |
| parent | add9745adc2fa13e6a6e2c26c78dcb05da031a44 (diff) | |
btrfs: do not call close_fs_devices in btrfs_rm_device
There's a subtle case where if we're removing the seed device from a
file system we need to free its private copy of the fs_devices. However
we do not need to call close_fs_devices(), because at this point there
are no devices left to close as we've closed the last one. The only
thing that close_fs_devices() does is decrement ->opened, which should
be 1. We want to avoid calling close_fs_devices() here because it has a
lockdep_assert_held(&uuid_mutex), and we are going to stop holding the
uuid_mutex in this path.
So simply decrement the ->opened counter like we should, and then clean
up like normal. Also add a comment explaining what we're doing here as
I initially removed this code erroneously.
Reviewed-by: Anand Jain <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strlcpy.c')
0 files changed, 0 insertions, 0 deletions