Skip to content

Commit e51a9f5

Browse files
committed
block/graph-lock: fix missed wakeup in bdrv_graph_co_rdunlock()
Make aio_wait_kick() unconditional in bdrv_graph_co_rdunlock(). bdrv_graph_wrlock() zeroes has_writer while polling, so rdunlock cannot rely on has_writer to detect a waiting writer. The kick is a no-op when no one is waiting. Cherry-picked from upstream stable-11.0 commit fddafa15a9. Signed-off-by: Jason Truong <jason.truong@windriver.com>
1 parent 3cefd3b commit e51a9f5

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

block/graph-lock.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,6 @@ void coroutine_fn bdrv_graph_co_rdunlock(void)
277277
/* make sure writer sees reader_count before we check has_writer */
278278
smp_mb();
279279

280-
/*
281-
* has_writer == 0: this means reader will read reader_count decreased
282-
* has_writer == 1: we don't know if writer read reader_count old or
283-
* new. Therefore, kick again so on next iteration
284-
* writer will for sure read the updated value.
285-
*/
286280
/*
287281
* Always kick: bdrv_graph_wrlock() zeroes has_writer while polling (to
288282
* let callbacks take the reader lock via the fast path), so we cannot

0 commit comments

Comments
 (0)