fix disk_part_tbl always alloced in node 0: set node_id before refered in alloc_disk
PATCH 1/1 fix disk_part_tbl always alloced in node 0: set node_id before refered in alloc_disk
From: Cheng Renquan <[email protected]>
disk->node_id will be refered in allocating in disk_expand_part_tbl, so we should set it before disk->node_id is refered.
Signed-off-by Cheng Renquan <[email protected]>
--- block/genhd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
block/genhd.c +1 -1
@@ -1102,6 +1102,7 @@ struct gendisk *alloc_disk_node(int minors, int node_id)kfree (disk);return NULL ; } + disk->node_id = node_id;if (disk_expand_part_tbl (disk,0 )) {free_part_stats (&disk->part0);kfree (disk);
@@ -1116,7 +1117,6 @@ struct gendisk *alloc_disk_node(int minors, int node_id)device_initialize (disk_to_dev (disk));INIT_WORK (&disk->async_notify, media_change_notify_thread); - disk->node_id = node_id; }return disk; }
Signature · 1 line
1.6.0.4.758.g36c05
Quoted 23 lines · On Thu, Nov 20 2008, [email protected] wrote:
From: Cheng Renquan <[email protected]>
disk->node_idwill be refered in allocating indisk_expand_part_tbl, so we should set it beforedisk->node_idis refered.Signed-off-by Cheng Renquan <[email protected]>--- block/genhd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)block/genhd.c +1
-0@@ -1102,6 +1102,7 @@ struct gendisk *alloc_disk_node(int minors, int node_id)kfree (disk);return NULL ; } + disk->node_id = node_id;if (disk_expand_part_tbl (disk,0 )) {free_part_stats (&disk->part0);kfree (disk);
block/genhd.c struct gendisk *alloc_disk_node(int minors, int node_id) · line 1122
Quoted 7 lines
block/genhd.c +0
-1@@ -1116,7 +1117,6 @@ struct gendisk *alloc_disk_node(int minors, int node_id)device_initialize (disk_to_dev (disk));INIT_WORK (&disk->async_notify, media_change_notify_thread); - disk->node_id = node_id; }return disk; }
Good spotting, applied!
Signature · 1 line
Jens Axboe