aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/loop.c
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2010-10-27 21:51:30 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-10-27 21:51:30 -0400
commit51a0bb0c2e614659132fce272c8a1815a12c5c2a (patch)
tree93554b329e8e6cd9378641422dea4245c05a98dd /drivers/block/loop.c
parent12ba8d1e9262ce81a695795410bd9ee5c9407ba1 (diff)
loop: Properly clear sysfs in autoclear mode
In autoclear mode bdev is NULL but the sysfs entry should be destroyed otherwise this warning appears: WARNING: at fs/sysfs/dir.c:451 sysfs_add_one+0x82/0x95() sysfs: cannot create duplicate filename '/devices/virtual/block/loop0/loop' Fixes commit ee86273062cbb310665fe49e1f1937d2cf85b0b9 Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r--drivers/block/loop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 450c958b514f..1e5284ef65fa 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1049,9 +1049,9 @@ static int loop_clr_fd(struct loop_device *lo, struct block_device *bdev)
1049 if (bdev) 1049 if (bdev)
1050 invalidate_bdev(bdev); 1050 invalidate_bdev(bdev);
1051 set_capacity(lo->lo_disk, 0); 1051 set_capacity(lo->lo_disk, 0);
1052 loop_sysfs_exit(lo);
1052 if (bdev) { 1053 if (bdev) {
1053 bd_set_size(bdev, 0); 1054 bd_set_size(bdev, 0);
1054 loop_sysfs_exit(lo);
1055 /* let user-space know about this change */ 1055 /* let user-space know about this change */
1056 kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE); 1056 kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE);
1057 } 1057 }