From patchwork Wed Sep 13 11:10:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 139105 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:a8d:b0:3f2:4152:657d with SMTP id gr13csp98786vqb; Wed, 13 Sep 2023 14:33:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEAt3nqvQZGfhW5zQtQN5TxcwrhEV3gW5cgGoCp1U8yPUDYnup0E4fvyqhMKZyzFRWG1V4h X-Received: by 2002:a17:90b:4b82:b0:26d:689f:4253 with SMTP id lr2-20020a17090b4b8200b0026d689f4253mr9583976pjb.6.1694640817146; Wed, 13 Sep 2023 14:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694640817; cv=none; d=google.com; s=arc-20160816; b=tsUSpm6tenPmfQfKMfKTn4DgsYePxKPAhrVyax+PSNIltYLeaNytcZ65DHdl3CQpWh hgNyQwK2lyd+NmKIhJLgctEGAjN1AZ79jKANLB+9Na3HSDKlrjJ9ZkehO6RsK1zbKEg6 s/2UW/kHt1zjIHjUE8BdHbwL4+IeTYlgbbmpkLQhvdyDFtmpQVcBPiGF5HTCLm8jKAAQ 3dQl4HoX6ZoJCyI1fY5g9St/rRJfss0ukzhdvOF3+YMoZ5Vgjv8U5oDq2eMXlCcmXGhi WPgFJVooufDnjyfZL243hFFRHk03y0IZs+XiKPpzftVy8Td2u0IzCCGUoGt8FbQSGi3g OcXg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jhauY3/jneyf5WN9+Nuds+kBzVHdIqfAGUjcFJu8Bb0=; fh=BKhaubn3NgfOFdJuURkVVw5laQp2qzBZJf/ffKnJtu8=; b=iQ5L4sJTXHf/zlZZ9YPlzrbJTg9eSlJCPs7uQrAnFfkoYxE8roMx2GfkdQOa2TgNS7 bn7Z9oLSbqPjxMBboNszESvfDDnthym4K7CbUR5al9rggbBs06GzOelS7pUq6klE3IRK tDwqdmjGGJGVL/efl0ILyTsCqOQNcy+voSsyMIqQnYw57oGZPKwtQ9sEVRUP4DiKQHAW CSVNGwlPnSMI2ZGUZsfwnM2SeacjXDpHq1TedbPXf0Y4Rx09ZPC2yfnH+ZUN/bkmHqoy Yzv8jRBsobagVNKHa9KvF742RkFBpkZlo1u7ED8VZWWViMdQjkvyIgQ5LBRsbYfLlN8j HyQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=fUrXbSzY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id i23-20020a17090acf9700b0026b502223cbsi181055pju.10.2023.09.13.14.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 14:33:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=fUrXbSzY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 4DDA482DDF90; Wed, 13 Sep 2023 04:12:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240199AbjIMLLc (ORCPT + 36 others); Wed, 13 Sep 2023 07:11:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240016AbjIMLLO (ORCPT ); Wed, 13 Sep 2023 07:11:14 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 889702105; Wed, 13 Sep 2023 04:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=jhauY3/jneyf5WN9+Nuds+kBzVHdIqfAGUjcFJu8Bb0=; b=fUrXbSzYYwvk+a7iZ04b7uqo6O yMFzj0Gftg1cPI8xK6HOS5/2t5pgeno2tGYPOgwsJz/081bsx4S+hNeEiOj/9JPYM9Yjh8pEPvIg2 Wrp5GU4bcSIB4btcue4uQ/lOMQxCDrtTXQFGbsyz+e+Q/sq/NLIyVUnKS5kh30g1tvkUo+WWLbVI6 iV88O2PyuhopSrHum84IdH5rZrmRR5W3S1uhaN1V/StJdm9zQvhM3SCODI7SYCP057DWJJXxpllGa KmxajivmHPrvJKEQo0Mi/kfLGWHMHeQkzHNpZklea/6faKeUB06rySel8D+8dQfJ9GqlEYiIOG6Bi iwOUmqVA==; Received: from [190.210.221.22] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qgNlp-005i2V-0E; Wed, 13 Sep 2023 11:10:57 +0000 From: Christoph Hellwig To: Christian Brauner , Al Viro Cc: Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Fenghua Yu , Reinette Chatre , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Dennis Dalessandro , Tejun Heo , Trond Myklebust , Anna Schumaker , Kees Cook , Damien Le Moal , Naohiro Aota , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org, linux-hardening@vger.kernel.org, cgroups@vger.kernel.org Subject: [PATCH 10/19] USB: gadget/legacy: remove sb_mutex Date: Wed, 13 Sep 2023 08:10:04 -0300 Message-Id: <20230913111013.77623-11-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230913111013.77623-1-hch@lst.de> References: <20230913111013.77623-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Sep 2023 04:12:06 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776940098284261463 X-GMAIL-MSGID: 1776959689214515774 Creating new a new super_block vs freeing the old one for single instance file systems is serialized by the wait for SB_DEAD. Remove the superfluous sb_mutex. Signed-off-by: Christoph Hellwig --- drivers/usb/gadget/legacy/inode.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c index ce9e31f3d26bcc..a203266bc0dc82 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c @@ -229,7 +229,6 @@ static void put_ep (struct ep_data *data) */ static const char *CHIP; -static DEFINE_MUTEX(sb_mutex); /* Serialize superblock operations */ /*----------------------------------------------------------------------*/ @@ -2012,8 +2011,6 @@ gadgetfs_fill_super (struct super_block *sb, struct fs_context *fc) struct dev_data *dev; int rc; - mutex_lock(&sb_mutex); - if (the_device) { rc = -ESRCH; goto Done; @@ -2069,7 +2066,6 @@ gadgetfs_fill_super (struct super_block *sb, struct fs_context *fc) rc = -ENOMEM; Done: - mutex_unlock(&sb_mutex); return rc; } @@ -2092,7 +2088,6 @@ static int gadgetfs_init_fs_context(struct fs_context *fc) static void gadgetfs_kill_sb (struct super_block *sb) { - mutex_lock(&sb_mutex); kill_litter_super (sb); if (the_device) { put_dev (the_device); @@ -2100,7 +2095,6 @@ gadgetfs_kill_sb (struct super_block *sb) } kfree(CHIP); CHIP = NULL; - mutex_unlock(&sb_mutex); } /*----------------------------------------------------------------------*/