linux-aio: fix unbalanced plugged counter in laio_io_unplug()
commitf387cac5af030a58ac5a0dacf64cab5e5a4fe5c7
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 9 Jun 2022 16:47:11 +0000 (9 17:47 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 15 Jun 2022 15:43:42 +0000 (15 16:43 +0100)
treebb3ffcdbcf7184f2c1206e95e1723b2e2bb1d3e6
parent78e27dfa8d1c91171d49660aa50cbe6c424d41be
linux-aio: fix unbalanced plugged counter in laio_io_unplug()

Every laio_io_plug() call has a matching laio_io_unplug() call. There is
a plugged counter that tracks the number of levels of plugging and
allows for nesting.

The plugged counter must reflect the balance between laio_io_plug() and
laio_io_unplug() calls accurately. Otherwise I/O stalls occur since
io_submit(2) calls are skipped while plugged.

Reported-by: Nikolay Tenev <nt@storpool.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-id: 20220609164712.1539045-2-stefanha@redhat.com
Cc: Stefano Garzarella <sgarzare@redhat.com>
Fixes: 68d7946648 ("linux-aio: add `dev_max_batch` parameter to laio_io_unplug()")
[Stefano Garzarella suggested adding a Fixes tag.
--Stefan]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/linux-aio.c