Skip to content

Commit

Permalink
btrfs: don't try to notify udev about missing devices
Browse files Browse the repository at this point in the history
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 <sandeen@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
  • Loading branch information
Eric Sandeen authored and Chris Mason committed Feb 1, 2013
1 parent 57ba86c commit 3c91160
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,8 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
ret = 0;

/* Notify udev that device has changed */
btrfs_kobject_uevent(bdev, KOBJ_CHANGE);
if (bdev)
btrfs_kobject_uevent(bdev, KOBJ_CHANGE);

error_brelse:
brelse(bh);
Expand Down

0 comments on commit 3c91160

Please sign in to comment.