Skip to content

Commit 8130b9d

Browse files
Dongli Zhangbostrovs
authored andcommitted
xenbus: req->err should be updated before req->state
This patch adds the barrier to guarantee that req->err is always updated before req->state. Otherwise, read_reply() would not return ERR_PTR(req->err) but req->body, when process_writes()->xb_write() is failed. Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com> Link: https://lore.kernel.org/r/20200303221423.21962-2-dongli.zhang@oracle.com Reviewed-by: Julien Grall <jgrall@amazon.com> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
1 parent 1b6a51e commit 8130b9d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/xen/xenbus/xenbus_comms.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,8 @@ static int process_writes(void)
397397
if (state.req->state == xb_req_state_aborted)
398398
kfree(state.req);
399399
else {
400+
/* write err, then update state */
401+
virt_wmb();
400402
state.req->state = xb_req_state_got_reply;
401403
wake_up(&state.req->wq);
402404
}

0 commit comments

Comments
 (0)