From patchwork Fri Aug 29 21:42:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 384397 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F2AA914012B for ; Sat, 30 Aug 2014 07:45:40 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XNTxu-0006NJ-3Q; Fri, 29 Aug 2014 21:44:14 +0000 Received: from top.free-electrons.com ([176.31.233.9] helo=mail.free-electrons.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XNTxq-0006KB-4X for linux-mtd@lists.infradead.org; Fri, 29 Aug 2014 21:44:10 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 12E5F751; Fri, 29 Aug 2014 23:43:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (unknown [190.2.108.81]) by mail.free-electrons.com (Postfix) with ESMTPSA id 5B312E8; Fri, 29 Aug 2014 23:43:49 +0200 (CEST) From: Ezequiel Garcia To: , Artem Bityutskiy Subject: [PATCH 3/3] UBI: Dispatch update notification if the volume is updated Date: Fri, 29 Aug 2014 18:42:30 -0300 Message-Id: <1409348550-27768-4-git-send-email-ezequiel.garcia@free-electrons.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1409348550-27768-1-git-send-email-ezequiel.garcia@free-electrons.com> References: <1409348550-27768-1-git-send-email-ezequiel.garcia@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140829_144410_325978_86D0B316 X-CRM114-Status: UNSURE ( 8.67 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Brian Norris , Ezequiel Garcia , =?UTF-8?q?Guido=20Mart=C3=ADnez?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The UBI_IOCVOLUP ioctl is used to start an update and also to truncate a volume. In the first case, a "volume updated" notification is dispatched when the update is done. This commit adds the "volume updated" notification to be also sent when the volume is truncated. This is required for UBI block and gluebi to get notified about the new volume size. Signed-off-by: Ezequiel Garcia --- drivers/mtd/ubi/cdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 7646220..20aeb27 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c @@ -425,8 +425,10 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd, break; err = ubi_start_update(ubi, vol, bytes); - if (bytes == 0) + if (bytes == 0) { + ubi_volume_notify(ubi, vol, UBI_VOLUME_UPDATED); revoke_exclusive(desc, UBI_READWRITE); + } break; }