Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3090922rwb; Mon, 15 Aug 2022 17:54:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6KE+1HEU0O6DtR9IenJ0rY7X/aYyGe1Bp6/mgDIGM94P8z/HRraFS24TYJ6i99DI8m/lFY X-Received: by 2002:a17:907:3ea5:b0:730:8b95:dc69 with SMTP id hs37-20020a1709073ea500b007308b95dc69mr11971843ejc.34.1660611263202; Mon, 15 Aug 2022 17:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611263; cv=none; d=google.com; s=arc-20160816; b=SDBfmMTNG+0GW6Wj+nKRcPPcLg2NdPP6vZ0CA+EBpncFvq8BIYL/Oy3k+XSIcpkidf uZo1OpyrxXjjxL2YM5qGnsS/eqGEYFlxHcQgTBCD6OAQcFkQDpVhMlSJyrVqUbchLKdS F1knrgSlc8P9duDlutteSc4JYuqeTe0fds8qI0LTqtdPsaGhpPGWHA8CMtVIQWG6C4gH FXC7G6fZwG3YASoe8BENtDF6SKLt3C85RWmh/oSTnNEW8CR0CMiOU/S76LQmlTzXsfoQ H9t6tcLUsCpn8g9Wo8Z3tMr+Xecb0G8Rh2MRnr0TazA78Y+GXc7mtr8Q+0JW4Nmk4AQE 3lHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Qlw6jP2gvwUEG+G7X0E2hreMrXd9Rl1bj87KzYm6xpg=; b=f1QeOeKmD8AHE3SwMFBfgkEfUBL+jg5A1UFrdmsZZX4kP9WowBo+A6yI9AGh6nFmlg Q9Er3xY6OTEoU6TIvuPuKCpWk1PSRBJKGAZmmbTTM9DeYjUlhuBwGb174+ubavu20dIz hlvoBZj9mLQOtDyaxpJ4X0DUmbSPNGv3AG6v1OjFazrmZEcKThmwcqg9I2rH/c+zKYCt s03GOU0IfGXxCxeFTc9uQKszLSwCkLV+PiMIW4SeCjkFjg9v8F31KP+cTX7YXaYXjQNd SvrVCQS1sMIvx72Q8YK7PqCEl/awW5h2TvXYlSGophIAK/SkQKmLs/GuN6YvBAv2LpeN Cnhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ENYNfEJY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rn8-20020a170906d92800b007316d39c2cbsi8069629ejb.516.2022.08.15.17.53.57; Mon, 15 Aug 2022 17:54:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ENYNfEJY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343553AbiHOXMC (ORCPT + 99 others); Mon, 15 Aug 2022 19:12:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353162AbiHOXK6 (ORCPT ); Mon, 15 Aug 2022 19:10:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10670144E0D; Mon, 15 Aug 2022 13:00:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 363F261226; Mon, 15 Aug 2022 20:00:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BFD3C433C1; Mon, 15 Aug 2022 20:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593607; bh=q7HeBn6uyB5qIMUcOE0UZOInjM7NHBYSfG82jh+373g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ENYNfEJYtewKl52hFCWiIAUHLe+tqFha4siR75V2csSFGVv00gyDdZifjMg+N6UDv ROXcrqI3BotwkR24BMPnSMhAv9GebGS5yCt5rt/ZPGnZLoPS+e9VJ8+3hyNbNr/ut5 snoaF+1t8GnwVXb8/D26EriBv/DLSLi6na7f/G48= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Michal=20Koutn=C3=BD?= , Roman Gushchin , Jens Axboe , Sasha Levin Subject: [PATCH 5.19 0295/1157] io_uring: Dont require reinitable percpu_ref Date: Mon, 15 Aug 2022 19:54:11 +0200 Message-Id: <20220815180451.432936539@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Koutný [ Upstream commit 48904229928d941ce1db181b991948387ab463cd ] The commit 8bb649ee1da3 ("io_uring: remove ring quiesce for io_uring_register") removed the worklow relying on reinit/resurrection of the percpu_ref, hence, initialization with that requested is a relic. This is based on code review, this causes no real bug (and theoretically can't). Technically it's a revert of commit 214828962dea ("io_uring: initialize percpu refcounters using PERCU_REF_ALLOW_REINIT") but since the flag omission is now justified, I'm not making this a revert. Fixes: 8bb649ee1da3 ("io_uring: remove ring quiesce for io_uring_register") Signed-off-by: Michal Koutný Acked-by: Roman Gushchin Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index f429b68d1fc2..27ce532c6c8d 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1701,7 +1701,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p) ctx->dummy_ubuf->ubuf = -1UL; if (percpu_ref_init(&ctx->refs, io_ring_ctx_ref_free, - PERCPU_REF_ALLOW_REINIT, GFP_KERNEL)) + 0, GFP_KERNEL)) goto err; ctx->flags = p->flags; -- 2.35.1