From patchwork Thu Oct 27 14:44:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Yudaken X-Patchwork-Id: 13022233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC28FECAAA1 for ; Thu, 27 Oct 2022 14:45:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235573AbiJ0Opf (ORCPT ); Thu, 27 Oct 2022 10:45:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235973AbiJ0OpQ (ORCPT ); Thu, 27 Oct 2022 10:45:16 -0400 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A3595007A for ; Thu, 27 Oct 2022 07:44:45 -0700 (PDT) Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29RCQwCU020105 for ; Thu, 27 Oct 2022 07:44:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=s2048-2021-q4; bh=i0m3HvjHtQJzfKPhG7yfhZLaobj4QR5Zl/Lyydu9vOo=; b=Fhz2MTC364A6Q2rWqsPKvkc5uvgm3668O9ZDwM9M4F5KUhYZgPZ/g4wybrcK4jTRtodU VjFqnoee/Vr/5W4gem0ZZOpRO6C4q3SpZwO2zL23RYNrAhcQBWQsThZ9VQsWm6dNoH0U GOI6XtOdclasi1C71CGjkGjecAclJIFKKZsIkV4SusAetTq1pYrJDC95gLMdL/BTN50W 686cgpxCrV/lM4UiDQdRYWnv+FqAEWTinbkrl6BCbfooSF6XReGHpIeFXi4YWYc7MUUI xzbolcZBFiJA6ZH5zKFvqM3Tj1f1EwIWeDkDWW4iyIiPJWZGsSicG3bMMPeDivOmmSzF nw== Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3kfagyhksq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 27 Oct 2022 07:44:44 -0700 Received: from twshared9269.07.ash9.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::f) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 27 Oct 2022 07:44:43 -0700 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id 327488673CAB; Thu, 27 Oct 2022 07:44:34 -0700 (PDT) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov CC: , , Dylan Yudaken Subject: [PATCH 0/2] io_uring: fix locking in __io_run_local_work Date: Thu, 27 Oct 2022 07:44:27 -0700 Message-ID: <20221027144429.3971400-1-dylany@meta.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: KFyAl7P7VOUZ1ZQcQwmLvZGuewVc-d0Z X-Proofpoint-ORIG-GUID: KFyAl7P7VOUZ1ZQcQwmLvZGuewVc-d0Z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-27_07,2022-10-27_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org If locked was not set in __io_run_local_work, but some task work managed to lock the context, it would leave things locked indefinitely. Fix that by passing the pointer in. Patch 1 is a tiny cleanup to simplify things Patch 2 is the fix Dylan Yudaken (2): io_uring: use io_run_local_work_locked helper io_uring: unlock if __io_run_local_work locked inside io_uring/io_uring.c | 11 +++++------ io_uring/io_uring.h | 12 ++++++++++-- 2 files changed, 15 insertions(+), 8 deletions(-) base-commit: 247f34f7b80357943234f93f247a1ae6b6c3a740