Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233641
b: refs/heads/master
c: e7407d1
h: refs/heads/master
i:
  233639: af51f25
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 24, 2011
1 parent f4c8a2a commit fe59efa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8074b26f67165bf045d92e778c9c10dc5e207fc6
refs/heads/master: e7407d1619713f4b1fdff3a485e1bd8e77bd480d
6 changes: 6 additions & 0 deletions trunk/fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,11 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk)
ret = add_symlink(bdev->bd_part->holder_dir, &disk_to_dev(disk)->kobj);
if (ret)
goto out_del;
/*
* bdev could be deleted beneath us which would implicitly destroy
* the holder directory. Hold on to it.
*/
kobject_get(bdev->bd_part->holder_dir);

list_add(&holder->list, &bdev->bd_holder_disks);
goto out_unlock;
Expand Down Expand Up @@ -909,6 +914,7 @@ void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk)
del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj);
del_symlink(bdev->bd_part->holder_dir,
&disk_to_dev(disk)->kobj);
kobject_put(bdev->bd_part->holder_dir);
list_del_init(&holder->list);
kfree(holder);
}
Expand Down

0 comments on commit fe59efa

Please sign in to comment.