Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356554
b: refs/heads/master
c: 25e823c
h: refs/heads/master
v: v3
  • Loading branch information
Ming Lei authored and Linus Torvalds committed Feb 24, 2013
1 parent da8fe48 commit 07d695b
Show file tree
Hide file tree
Showing 2 changed files with 11 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: e823407f7b11fa06ba8e7a2801eb9ed11268a7ec
refs/heads/master: 25e823c8c37d123b77ce12a042da889e6bb5f9d1
10 changes: 10 additions & 0 deletions trunk/block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/mutex.h>
#include <linux/idr.h>
#include <linux/log2.h>
#include <linux/pm_runtime.h>

#include "blk.h"

Expand Down Expand Up @@ -534,6 +535,14 @@ static void register_disk(struct gendisk *disk)
return;
}
}

/*
* avoid probable deadlock caused by allocating memory with
* GFP_KERNEL in runtime_resume callback of its all ancestor
* devices
*/
pm_runtime_set_memalloc_noio(ddev, true);

disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj);
disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj);

Expand Down Expand Up @@ -663,6 +672,7 @@ void del_gendisk(struct gendisk *disk)
disk->driverfs_dev = NULL;
if (!sysfs_deprecated)
sysfs_remove_link(block_depr, dev_name(disk_to_dev(disk)));
pm_runtime_set_memalloc_noio(disk_to_dev(disk), false);
device_del(disk_to_dev(disk));
}
EXPORT_SYMBOL(del_gendisk);
Expand Down

0 comments on commit 07d695b

Please sign in to comment.