Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1820090/?format=api
{ "id": 1820090, "url": "http://patchwork.ozlabs.org/api/patches/1820090/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/bac56760e1abec46e1ca5582fc30cbca1f42af9d.1691717480.git.daniel@makrotopia.org/", "project": { "id": 3, "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api", "name": "Linux MTD development", "link_name": "linux-mtd", "list_id": "linux-mtd.lists.infradead.org", "list_email": "linux-mtd@lists.infradead.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<bac56760e1abec46e1ca5582fc30cbca1f42af9d.1691717480.git.daniel@makrotopia.org>", "list_archive_url": null, "date": "2023-08-11T01:37:12", "name": "[v4,3/8] mtd: ubi: block: don't return on error when removing", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "b786edfb8201b93d77ac610027cb31930bd21529", "submitter": { "id": 64091, "url": "http://patchwork.ozlabs.org/api/people/64091/?format=api", "name": "Daniel Golle", "email": "daniel@makrotopia.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/bac56760e1abec46e1ca5582fc30cbca1f42af9d.1691717480.git.daniel@makrotopia.org/mbox/", "series": [ { "id": 368347, "url": "http://patchwork.ozlabs.org/api/series/368347/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=368347", "date": "2023-08-11T01:36:37", "name": "mtd: ubi: allow UBI volumes to provide NVMEM", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/368347/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1820090/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1820090/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=<UNKNOWN>)", "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=fB34B31L;\n\tdkim-atps=neutral" ], "Received": [ "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4RMRJ35dc4z1yf2\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 11 Aug 2023 11:37:55 +1000 (AEST)", "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux))\n\tid 1qUH5l-00952M-1P;\n\tFri, 11 Aug 2023 01:37:29 +0000", "from pidgin.makrotopia.org ([185.142.180.65])\n\tby bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux))\n\tid 1qUH5h-00951B-19\n\tfor linux-mtd@lists.infradead.org;\n\tFri, 11 Aug 2023 01:37:27 +0000", "from local\n\tby pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256)\n\t (Exim 4.96)\n\t(envelope-from <daniel@makrotopia.org>)\n\tid 1qUH5b-00053x-15;\n\tFri, 11 Aug 2023 01:37:19 +0000" ], "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=G0eWlqhRcl2fW27oQ8hkx+AM1NhyzIqsaappclAXBq8=; b=fB34B31LfLZGLa\n\tIRMzH8Uuhq9wpfeeBQvrTluNj4XZPW07R9dC8VXKeMkOJfTcmPr7Ii/zDURAUD+usMV7r+Mvgyuhs\n\tt0lBAxLW/2MtF/dOifRgnP2li9AA9WTlxatPk39KigKsXVPH8+JHESKv95t9LOTwjNBoXybO4bICb\n\tSHHTBAwe1Ku1gwH24LDQX521U6zHgyom9UFICcSXHxfieVk0yVB05VZ0/JAFsQwzjR44WjzJPaMGQ\n\tNn2NFLxgy4zaccsr5FxKiu5Fe3nrq7s0n8sPGDIxBYwkFgVP/Gk7zzT/SJNpmoR3NV/CNMKI7LUez\n\tegIe7PWhDuhDsyLK7d0A==;", "Date": "Fri, 11 Aug 2023 02:37:12 +0100", "From": "Daniel Golle <daniel@makrotopia.org>", "To": "Randy Dunlap <rdunlap@infradead.org>,\n\tMiquel Raynal <miquel.raynal@bootlin.com>,\n\tRichard Weinberger <richard@nod.at>,\n\tVignesh Raghavendra <vigneshr@ti.com>,\n\tRob Herring <robh+dt@kernel.org>,\n\tKrzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,\n\tConor Dooley <conor+dt@kernel.org>,\n\tDaniel Golle <daniel@makrotopia.org>, linux-mtd@lists.infradead.org,\n\tdevicetree@vger.kernel.org, linux-kernel@vger.kernel.org", "Subject": "[PATCH v4 3/8] mtd: ubi: block: don't return on error when removing", "Message-ID": "\n <bac56760e1abec46e1ca5582fc30cbca1f42af9d.1691717480.git.daniel@makrotopia.org>", "References": "<cover.1691717480.git.daniel@makrotopia.org>", "MIME-Version": "1.0", "Content-Disposition": "inline", "In-Reply-To": "<cover.1691717480.git.daniel@makrotopia.org>", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20230810_183725_394591_E1D1539F ", "X-CRM114-Status": "GOOD ( 17.19 )", "X-Spam-Score": "0.0 (/)", "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam. The original\n message has been attached to this so you can view it or label\n similar future email. If you have any questions, see\n the administrator of that system for details.\n Content preview: There is no point on returning the error from\n ubiblock_remove\n in case it is being called due to a volume removal event -- the volume is\n gone, we should destroy and remove the ubiblock device no matter [...]\n Content analysis details: (0.0 points, 5.0 required)\n pts rule name description\n ---- ----------------------\n --------------------------------------------------\n -0.0 SPF_PASS SPF: sender matches SPF record\n 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record", "X-BeenThere": "linux-mtd@lists.infradead.org", "X-Mailman-Version": "2.1.34", "Precedence": "list", "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>", "List-Post": "<mailto:linux-mtd@lists.infradead.org>", "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>", "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "There is no point on returning the error from ubiblock_remove in case\nit is being called due to a volume removal event -- the volume is gone,\nwe should destroy and remove the ubiblock device no matter what.\n\nIntroduce new boolean parameter 'force' to tell ubiblock_remove to go\non even in case the ubiblock device is still busy. Use that new option\nwhen calling ubiblock_remove due to a UBI_VOLUME_REMOVED event.\n\nSigned-off-by: Daniel Golle <daniel@makrotopia.org>\n---\n drivers/mtd/ubi/block.c | 6 +++---\n drivers/mtd/ubi/cdev.c | 2 +-\n drivers/mtd/ubi/ubi.h | 4 ++--\n 3 files changed, 6 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c\nindex 437c5b83ffe51..69fa6fecb8494 100644\n--- a/drivers/mtd/ubi/block.c\n+++ b/drivers/mtd/ubi/block.c\n@@ -456,7 +456,7 @@ static void ubiblock_cleanup(struct ubiblock *dev)\n \tidr_remove(&ubiblock_minor_idr, dev->gd->first_minor);\n }\n \n-int ubiblock_remove(struct ubi_volume_info *vi)\n+int ubiblock_remove(struct ubi_volume_info *vi, bool force)\n {\n \tstruct ubiblock *dev;\n \tint ret;\n@@ -470,7 +470,7 @@ int ubiblock_remove(struct ubi_volume_info *vi)\n \n \t/* Found a device, let's lock it so we can check if it's busy */\n \tmutex_lock(&dev->dev_mutex);\n-\tif (dev->refcnt > 0) {\n+\tif (dev->refcnt > 0 && !force) {\n \t\tret = -EBUSY;\n \t\tgoto out_unlock_dev;\n \t}\n@@ -545,7 +545,7 @@ static int ubiblock_notify(struct notifier_block *nb,\n \t\t */\n \t\tbreak;\n \tcase UBI_VOLUME_REMOVED:\n-\t\tubiblock_remove(&nt->vi);\n+\t\tubiblock_remove(&nt->vi, true);\n \t\tbreak;\n \tcase UBI_VOLUME_RESIZED:\n \t\tubiblock_resize(&nt->vi);\ndiff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c\nindex f43430b9c1e65..bb55e863dd296 100644\n--- a/drivers/mtd/ubi/cdev.c\n+++ b/drivers/mtd/ubi/cdev.c\n@@ -572,7 +572,7 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd,\n \t\tstruct ubi_volume_info vi;\n \n \t\tubi_get_volume_info(desc, &vi);\n-\t\terr = ubiblock_remove(&vi);\n+\t\terr = ubiblock_remove(&vi, false);\n \t\tbreak;\n \t}\n \ndiff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h\nindex c8f1bd4fa1008..44c0eeaf1e1b0 100644\n--- a/drivers/mtd/ubi/ubi.h\n+++ b/drivers/mtd/ubi/ubi.h\n@@ -979,7 +979,7 @@ static inline void ubi_fastmap_destroy_checkmap(struct ubi_volume *vol) {}\n int ubiblock_init(void);\n void ubiblock_exit(void);\n int ubiblock_create(struct ubi_volume_info *vi);\n-int ubiblock_remove(struct ubi_volume_info *vi);\n+int ubiblock_remove(struct ubi_volume_info *vi, bool force);\n #else\n static inline int ubiblock_init(void) { return 0; }\n static inline void ubiblock_exit(void) {}\n@@ -987,7 +987,7 @@ static inline int ubiblock_create(struct ubi_volume_info *vi)\n {\n \treturn -ENOSYS;\n }\n-static inline int ubiblock_remove(struct ubi_volume_info *vi)\n+static inline int ubiblock_remove(struct ubi_volume_info *vi, bool force)\n {\n \treturn -ENOSYS;\n }\n", "prefixes": [ "v4", "3/8" ] }