block_device's bd_disk points to the disk, not the object which block_device
is actually corresponding to(the whole disk or a partition), so we would send
uevent to the wrong target. Fix it.

Signed-off-by: Miao Xie <[email protected]>
---
 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 95828b0..e8b9214 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -123,7 +123,7 @@ static void btrfs_kobject_uevent(struct block_device *bdev,
 {
        int ret;
 
-       ret = kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, action);
+       ret = kobject_uevent(&part_to_dev(bdev->bd_part)->kobj, action);
        if (ret)
                pr_warn("BTRFS: Sending event '%d' to kobject: '%s' (%p): 
failed\n",
                        action,
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to