Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127729
b: refs/heads/master
c: 8b76539
h: refs/heads/master
i:
  127727: 25c2310
v: v3
  • Loading branch information
NeilBrown committed Jan 8, 2009
1 parent 7b62709 commit 733f843
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cd2ac9321c26dc7a76455cd2a4df89123fa2b73e
refs/heads/master: 8b76539823d71576927e3eb08b395eb6620f628d
28 changes: 17 additions & 11 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ static void mddev_put(mddev_t *mddev)
if (!mddev->raid_disks && list_empty(&mddev->disks)) {
list_del(&mddev->all_mddevs);
spin_unlock(&all_mddevs_lock);
blk_cleanup_queue(mddev->queue);
if (mddev->queue)
blk_cleanup_queue(mddev->queue);
mddev->queue = NULL;
if (mddev->sysfs_state)
sysfs_put(mddev->sysfs_state);
mddev->sysfs_state = NULL;
Expand Down Expand Up @@ -275,16 +277,6 @@ static mddev_t * mddev_find(dev_t unit)
new->resync_max = MaxSector;
new->level = LEVEL_NONE;

new->queue = blk_alloc_queue(GFP_KERNEL);
if (!new->queue) {
kfree(new);
return NULL;
}
/* Can be unlocked because the queue is new: no concurrency */
queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, new->queue);

blk_queue_make_request(new->queue, md_fail_request);

goto retry;
}

Expand Down Expand Up @@ -3493,9 +3485,23 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data)
mddev_put(mddev);
return NULL;
}

mddev->queue = blk_alloc_queue(GFP_KERNEL);
if (!mddev->queue) {
mutex_unlock(&disks_mutex);
mddev_put(mddev);
return NULL;
}
/* Can be unlocked because the queue is new: no concurrency */
queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, mddev->queue);

blk_queue_make_request(mddev->queue, md_fail_request);

disk = alloc_disk(1 << shift);
if (!disk) {
mutex_unlock(&disks_mutex);
blk_cleanup_queue(mddev->queue);
mddev->queue = NULL;
mddev_put(mddev);
return NULL;
}
Expand Down

0 comments on commit 733f843

Please sign in to comment.