From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B2F5C433DF for ; Thu, 15 Oct 2020 12:02:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D98A021D7F for ; Thu, 15 Oct 2020 12:02:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387627AbgJOMAX (ORCPT ); Thu, 15 Oct 2020 08:00:23 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:34427 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730039AbgJOLzy (ORCPT ); Thu, 15 Oct 2020 07:55:54 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kT1rK-0004cr-Mt; Thu, 15 Oct 2020 11:55:50 +0000 From: Colin King To: Alexander Viro , Jens Axboe , Pavel Begunkov , linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] io_uring: fix flags check for the REQ_F_WORK_INITIALIZED setting Date: Thu, 15 Oct 2020 12:55:50 +0100 Message-Id: <20201015115550.485235-1-colin.king@canonical.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Colin Ian King Currently the check for REQ_F_WORK_INITIALIZED is always true because the | operator is being used. I believe this check should be checking if the bit is set using the & operator. Addresses-Coverity: ("Wrong operator used") Fixes: 9c357fed168a ("io_uring: fix REQ_F_COMP_LOCKED by killing it") Signed-off-by: Colin Ian King --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 01d0b35415dc..5ef54df03d7c 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1813,7 +1813,7 @@ static void __io_fail_links(struct io_kiocb *req) * but avoid REQ_F_WORK_INITIALIZED because it may deadlock on * work.fs->lock. */ - if (link->flags | REQ_F_WORK_INITIALIZED) + if (link->flags & REQ_F_WORK_INITIALIZED) io_put_req_deferred(link, 2); else io_double_put_req(link); -- 2.27.0