From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Dmitry Fomichev Subject: [PATCH v3 09/38] zbd: don't unlock zone mutex after verify replay Date: Thu, 7 Jan 2021 06:57:10 +0900 Message-Id: <20210106215739.264524-10-dmitry.fomichev@wdc.com> In-Reply-To: <20210106215739.264524-1-dmitry.fomichev@wdc.com> References: <20210106215739.264524-1-dmitry.fomichev@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: Jens Axboe , fio@vger.kernel.org, Aravind Ramesh , Bart Van Assche , Naohiro Aota , Niklas Cassel Cc: Damien Le Moal , Shinichiro Kawasaki , Dmitry Fomichev List-ID: zbd_adjust_block() always returns with the zone locked if the i/o is accepted. The corresponding unlock happens in zbd_put_io(). The function description says - * Locking strategy: returns with z->mutex locked if and only if z refers * to a sequential zone and if io_u_accept is returned. z is the zone that * corresponds to io_u->offset at the end of this function. Remove the recently added unlock after zbd_replay_write_order() call. Add a Coverity annotation to mark the absence of unlock as intentional. Fixes: b2726d53bb5d ("zbd: Add a missing pthread_mutex_unlock() call") Signed-off-by: Dmitry Fomichev --- zbd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zbd.c b/zbd.c index db0d650a..c1db215e 100644 --- a/zbd.c +++ b/zbd.c @@ -1561,7 +1561,12 @@ enum io_u_action zbd_adjust_block(struct thread_data *td, struct io_u *io_u) case DDIR_READ: if (td->runstate == TD_VERIFYING && td_write(td)) { zb = zbd_replay_write_order(td, io_u, zb); - zone_unlock(zb); + /* + * Since we return with the zone lock still held, + * add an annotation to let Coverity know that it + * is intentional. + */ + /* coverity[missing_unlock] */ goto accept; } /* -- 2.28.0