Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276690
b: refs/heads/master
c: 5eb4685
h: refs/heads/master
v: v3
  • Loading branch information
Yasuaki Ishimatsu authored and Jens Axboe committed Dec 2, 2011
1 parent abb50aa commit d6df632
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: 2984ff38ccf6cbc02a7a996a36c7d6f69f3c6146
refs/heads/master: 5eb46851de3904cd1be9192fdacb8d34deadc1fc
11 changes: 9 additions & 2 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3184,7 +3184,7 @@ static int cfq_cic_link(struct cfq_data *cfqd, struct io_context *ioc,
}
}

if (ret)
if (ret && ret != -EEXIST)
printk(KERN_ERR "cfq: cic link failed!\n");

return ret;
Expand All @@ -3200,13 +3200,15 @@ cfq_get_io_context(struct cfq_data *cfqd, gfp_t gfp_mask)
{
struct io_context *ioc = NULL;
struct cfq_io_context *cic;
int ret;

might_sleep_if(gfp_mask & __GFP_WAIT);

ioc = get_io_context(gfp_mask, cfqd->queue->node);
if (!ioc)
return NULL;

retry:
cic = cfq_cic_lookup(cfqd, ioc);
if (cic)
goto out;
Expand All @@ -3215,7 +3217,12 @@ cfq_get_io_context(struct cfq_data *cfqd, gfp_t gfp_mask)
if (cic == NULL)
goto err;

if (cfq_cic_link(cfqd, ioc, cic, gfp_mask))
ret = cfq_cic_link(cfqd, ioc, cic, gfp_mask);
if (ret == -EEXIST) {
/* someone has linked cic to ioc already */
cfq_cic_free(cic);
goto retry;
} else if (ret)
goto err_free;

out:
Expand Down

0 comments on commit d6df632

Please sign in to comment.