Skip to content

Commit 366f501

Browse files
jgross1gregkh
authored andcommitted
xen/blkback: don't use xen_blkif_get() in xen-blkback kthread
commit a24fa22ce22ae302b3bf8f7008896d52d5d57b8d upstream. There is no need to use xen_blkif_get()/xen_blkif_put() in the kthread of xen-blkback. Thread stopping is synchronous and using the blkif reference counting in the kthread will avoid to ever let the reference count drop to zero at the end of an I/O running concurrent to disconnecting and multiple rings. Setting ring->xenblkd to NULL after stopping the kthread isn't needed as the kthread does this already. Signed-off-by: Juergen Gross <jgross@suse.com> Tested-by: Steven Haigh <netwiz@crc.id.au> Acked-by: Roger Pau Monné <roger.pau@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 53f5772 commit 366f501

2 files changed

Lines changed: 0 additions & 4 deletions

File tree

drivers/block/xen-blkback/blkback.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,6 @@ int xen_blkif_schedule(void *arg)
595595
unsigned long timeout;
596596
int ret;
597597

598-
xen_blkif_get(blkif);
599-
600598
while (!kthread_should_stop()) {
601599
if (try_to_freeze())
602600
continue;
@@ -650,7 +648,6 @@ int xen_blkif_schedule(void *arg)
650648
print_stats(blkif);
651649

652650
blkif->xenblkd = NULL;
653-
xen_blkif_put(blkif);
654651

655652
return 0;
656653
}

drivers/block/xen-blkback/xenbus.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif)
221221
if (blkif->xenblkd) {
222222
kthread_stop(blkif->xenblkd);
223223
wake_up(&blkif->shutdown_wq);
224-
blkif->xenblkd = NULL;
225224
}
226225

227226
/* The above kthread_stop() guarantees that at this point we

0 commit comments

Comments
 (0)