فهرست منبع

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 <sandeen@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Eric Sandeen 12 سال پیش
والد
کامیت
3c91160808
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      fs/btrfs/volumes.c

+ 2 - 1
fs/btrfs/volumes.c

@@ -1556,7 +1556,8 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
 	ret = 0;
 	ret = 0;
 
 
 	/* Notify udev that device has changed */
 	/* Notify udev that device has changed */
-	btrfs_kobject_uevent(bdev, KOBJ_CHANGE);
+	if (bdev)
+		btrfs_kobject_uevent(bdev, KOBJ_CHANGE);
 
 
 error_brelse:
 error_brelse:
 	brelse(bh);
 	brelse(bh);