aboutsummaryrefslogtreecommitdiffstats
path: root/fs/attr.c
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2019-12-04 14:36:39 +0100
committerDavid Sterba <dsterba@suse.com>2020-01-20 16:40:53 +0100
commit321f69f86a0fc40203b43659c3a39464f15c2ee9 (patch)
tree81f49161c70d86f27389284b3680a7479ab40571 /fs/attr.c
parentbtrfs: decrement number of open devices after closing the device not before (diff)
downloadlinux-dev-321f69f86a0fc40203b43659c3a39464f15c2ee9.tar.xz
linux-dev-321f69f86a0fc40203b43659c3a39464f15c2ee9.zip
btrfs: reset device back to allocation state when removing
When closing a device, btrfs_close_one_device() first allocates a new device, copies the device to close's name, replaces it in the dev_list with the copy and then finally frees it. This involves two memory allocation, which can potentially fail. As this code path is tricky to unwind, the allocation failures where handled by BUG_ON()s. But this copying isn't strictly needed, all that is needed is resetting the device in question to it's state it had after the allocation. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/attr.c')
0 files changed, 0 insertions, 0 deletions