提交 427a2153 编写于 作者: A antirez

access to already freed job structure fixed by statements reoredering

上级 85a27752
...@@ -7579,6 +7579,12 @@ static void vmCancelThreadedIOJob(robj *o) { ...@@ -7579,6 +7579,12 @@ static void vmCancelThreadedIOJob(robj *o) {
if (compareStringObjects(job->key,o) == 0) { if (compareStringObjects(job->key,o) == 0) {
redisLog(REDIS_DEBUG,"*** CANCELED %p (%s)\n", redisLog(REDIS_DEBUG,"*** CANCELED %p (%s)\n",
(void*)job, (char*)o->ptr); (void*)job, (char*)o->ptr);
/* Mark the pages as free since the swap didn't happened
* or happened but is now discarded. */
if (job->type == REDIS_IOJOB_DO_SWAP)
vmMarkPagesFree(job->page,job->pages);
/* Cancel the job. It depends on the list the job is
* living in. */
switch(i) { switch(i) {
case 0: /* io_newjobs */ case 0: /* io_newjobs */
/* If the job was yet not processed the best thing to do /* If the job was yet not processed the best thing to do
...@@ -7591,10 +7597,6 @@ static void vmCancelThreadedIOJob(robj *o) { ...@@ -7591,10 +7597,6 @@ static void vmCancelThreadedIOJob(robj *o) {
job->canceled = 1; job->canceled = 1;
break; break;
} }
/* Mark the pages as free since the swap didn't happened
* or happened but is not discarded. */
if (job->type == REDIS_IOJOB_DO_SWAP)
vmMarkPagesFree(job->page,job->pages);
/* Finally we have to adjust the storage type of the object /* Finally we have to adjust the storage type of the object
* in order to "UNDO" the operaiton. */ * in order to "UNDO" the operaiton. */
if (o->storage == REDIS_VM_LOADING) if (o->storage == REDIS_VM_LOADING)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册