Skip to content

Commit 3c91160

Browse files
Eric SandeenChris Mason
authored andcommitted
btrfs: don't try to notify udev about missing devices
If we remove a missing device, bdev is null, and if we send that off to btrfs_kobject_uevent we'll panic. Signed-off-by: Eric Sandeen <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent 57ba86c commit 3c91160

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/btrfs/volumes.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,8 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
15561556
ret = 0;
15571557

15581558
/* Notify udev that device has changed */
1559-
btrfs_kobject_uevent(bdev, KOBJ_CHANGE);
1559+
if (bdev)
1560+
btrfs_kobject_uevent(bdev, KOBJ_CHANGE);
15601561

15611562
error_brelse:
15621563
brelse(bh);

0 commit comments

Comments
 (0)