Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2135575rdb; Tue, 3 Oct 2023 11:14:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDgZ6Ld6ZWxWlxYCmeEyxzuPU21To6GBmSSlL9nKSJkw19jNaZIs+EUOzMukw4MHUbThVO X-Received: by 2002:a05:6a00:14c8:b0:68f:dcc1:4bef with SMTP id w8-20020a056a0014c800b0068fdcc14befmr449736pfu.7.1696356894117; Tue, 03 Oct 2023 11:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696356894; cv=none; d=google.com; s=arc-20160816; b=Pq8tqU8ILhhfRgtc42UXmg4T4dOCw5hywwPFbd2fTIZrk5QH/sem12hZLkwZrhasjf 1alyHesGVVfp391cTePAKXMz9DiF4Br2Gj3VcTNyzR6ZW3q7Gcq1niRM/F0JWIFcXdtX tJUO/2604xuBhYWLRJlP7Wx4PaBSoKaLNTKOGKYx1gQs7nZOB5aams3FlCZvIuqycInT pimIWlvc/JKxNtsiyWVdB8i3D/AVMlCooWaSacz1fVqCW8W8I0IONU9/Y7HqJmNE3V2y G+ZIgFmENnFRTWFr5z3r6FO4+XbR1d3Eu8LQX0evEn/5J1jJ6Uq4QPBOb7+tg2ypdEpo fGtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=mnzUshsToGZDAa0H2US2j8kc5IFr3wn7XgxnyzR+aXg=; fh=cnNcGImSCyHZg61Oq1lVwS9n8ovlUW+xOV8QcY0Hamw=; b=0Yp5NGIr/T0gGZoDsXtknK8ibyJvPUNgfFp50xp92JjUQIQ0aQ3g1u/ReU9r4lOwYv 5G2RpQ/UYXQ8CDrRMQgG/UtUk4cksXr2a3vD1uhohPFD+wlFqJf8AYxeI3BHoRQmL6+U R0lnWJDQqNuvVqVkhRq8bSAfXMQDoOmr9sWmkPQkQ+OymqLTrepVhDV3RnQR0Effs6vR evU3ibhG6JUG52SvwlKv+zxxWMpIuXmBvYq0+lo1D8YDoDylW5KNjOz60L2A73zIVb8t CngAqwbyUhOtMfbht/9KoYZCTjyETXNFjSP7SDwFLO5HoOotKAxJeRW3DXljp/Gjpuvs HXaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id d38-20020a634f26000000b00564bcae8b53si1877052pgb.803.2023.10.03.11.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 11:14:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 9392F82D757C; Tue, 3 Oct 2023 11:14:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231637AbjJCSOo convert rfc822-to-8bit (ORCPT + 99 others); Tue, 3 Oct 2023 14:14:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230291AbjJCSOo (ORCPT ); Tue, 3 Oct 2023 14:14:44 -0400 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B1FB83; Tue, 3 Oct 2023 11:14:40 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 864C16340E0E; Tue, 3 Oct 2023 20:14:37 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id QeJ_hbG7TRXa; Tue, 3 Oct 2023 20:14:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 899A36340DF3; Tue, 3 Oct 2023 20:14:36 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id MM3kCFtSHPOQ; Tue, 3 Oct 2023 20:14:36 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 5FCBC6340DE8; Tue, 3 Oct 2023 20:14:36 +0200 (CEST) Date: Tue, 3 Oct 2023 20:14:36 +0200 (CEST) From: Richard Weinberger To: Daniel Golle Cc: Randy Dunlap , Miquel Raynal , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-mtd , devicetree , linux-kernel Message-ID: <1553084515.31405.1696356876189.JavaMail.zimbra@nod.at> In-Reply-To: References: Subject: Re: [PATCH v4 3/8] mtd: ubi: block: don't return on error when removing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: block: don't return on error when removing Thread-Index: mEjhakoF9gHQlvYZWxhJOUfsm127PA== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,T_SPF_PERMERROR 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 03 Oct 2023 11:14:44 -0700 (PDT) ----- Ursprüngliche Mail ----- > Von: "Daniel Golle" > An: "Randy Dunlap" , "Miquel Raynal" , "richard" , > "Vignesh Raghavendra" , "Rob Herring" , "Krzysztof Kozlowski" > , "Conor Dooley" , "Daniel Golle" , > "linux-mtd" , "devicetree" , "linux-kernel" > > Gesendet: Freitag, 11. August 2023 03:37:12 > Betreff: [PATCH v4 3/8] mtd: ubi: block: don't return on error when removing > There is no point on returning the error from ubiblock_remove in case > it is being called due to a volume removal event -- the volume is gone, > we should destroy and remove the ubiblock device no matter what. > > Introduce new boolean parameter 'force' to tell ubiblock_remove to go > on even in case the ubiblock device is still busy. Use that new option > when calling ubiblock_remove due to a UBI_VOLUME_REMOVED event. > > Signed-off-by: Daniel Golle > --- > drivers/mtd/ubi/block.c | 6 +++--- > drivers/mtd/ubi/cdev.c | 2 +- > drivers/mtd/ubi/ubi.h | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c > index 437c5b83ffe51..69fa6fecb8494 100644 > --- a/drivers/mtd/ubi/block.c > +++ b/drivers/mtd/ubi/block.c > @@ -456,7 +456,7 @@ static void ubiblock_cleanup(struct ubiblock *dev) > idr_remove(&ubiblock_minor_idr, dev->gd->first_minor); > } > > -int ubiblock_remove(struct ubi_volume_info *vi) > +int ubiblock_remove(struct ubi_volume_info *vi, bool force) > { > struct ubiblock *dev; > int ret; > @@ -470,7 +470,7 @@ int ubiblock_remove(struct ubi_volume_info *vi) > > /* Found a device, let's lock it so we can check if it's busy */ > mutex_lock(&dev->dev_mutex); > - if (dev->refcnt > 0) { > + if (dev->refcnt > 0 && !force) { > ret = -EBUSY; > goto out_unlock_dev; Is it really safe to destroy the blk queue (via ubiblock_cleanup()) if refcnt is > 0? Thanks, //richard