From patchwork Fri Apr 24 19:58:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannu Nyman X-Patchwork-Id: 464400 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8C83F1402DA for ; Sat, 25 Apr 2015 05:58:43 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 6BE6228022B; Fri, 24 Apr 2015 21:57:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B6C7D28022B for ; Fri, 24 Apr 2015 21:57:25 +0200 (CEST) X-policyd-weight: using cached result; rate: -5.5 Received: from filtteri1.pp.htv.fi (filtteri1.pp.htv.fi [213.243.153.184]) by arrakis.dune.hu (Postfix) with ESMTP for ; Fri, 24 Apr 2015 21:57:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by filtteri1.pp.htv.fi (Postfix) with ESMTP id 5698421BA29 for ; Fri, 24 Apr 2015 22:58:25 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp5.welho.com ([213.243.153.39]) by localhost (filtteri1.pp.htv.fi [213.243.153.184]) (amavisd-new, port 10024) with ESMTP id yg8vMNHHFy8g for ; Fri, 24 Apr 2015 22:58:21 +0300 (EEST) Received: from [192.168.1.180] (87-92-23-160.bb.dnainternet.fi [87.92.23.160]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp5.welho.com (Postfix) with ESMTPS id 2FFA75BC005 for ; Fri, 24 Apr 2015 22:58:21 +0300 (EEST) To: OpenWrt Development List From: Hannu Nyman message-id: <553AA05C.9070803@iki.fi> Date: Fri, 24 Apr 2015 22:58:20 +0300 user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Thunderbird/39.0a2 mime-version: 1.0 Subject: [OpenWrt-Devel] [PATCH] mtd: correct/change warning text about partition split / read-only status X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Since the kernel/rootfs split handling was modified 2 years ago by r37283 ( https://dev.openwrt.org/changeset/37283 ) and by the subsequent checkins, users have seen rather scary mtd errors in the log at every boot. The message ends "-- forcing read-only", which looks a bit error-like. That error has been mentioned in some forum threads, when users have noticed this message instead of some actual error. [ 2.940000] 0x000000070000-0x000000ff0000 : "firmware" [ 2.970000] 2 netgear-fw partitions found on MTD device firmware [ 2.970000] 0x000000070000-0x000000188440 : "kernel" [ 2.980000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only [ 2.990000] 0x000000188440-0x000000ff0000 : "rootfs" [ 2.990000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only [ 3.010000] mtd: device 4 (rootfs) set to be root filesystem [ 3.010000] 1 squashfs-split partitions found on MTD device rootfs [ 3.020000] 0x000000660000-0x000000ff0000 : "rootfs_data" The error text 'mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only' originates from 6 years ago, when nbd checked in r17658 to kernel 2.6.30. https://dev.openwrt.org/changeset/17658 https://dev.openwrt.org/browser/trunk/target/linux/generic-2.6/patches-2.6.30/222-partial_eraseblock_write.patch?rev=17658 At that time, this message was rarely shown, as it was normal to have padding after kernel, so that rootfs started at the next block boundary. Currently many platforms have kernel & rootfs tightly packed without padding in between, so the message is shown quite frequently. Additionally, I think that the original warning message has a logical fault: the first "or" should be "and". It should say "must either start AND end on erase block boundary or be smaller than an erase block". (otherwise 'kernel' should not cause the warning message as it starts at a boundary...). The logic in 411-mtd-partial_eraseblock_write.patch is pretty hard to follow, but that is my reading about the correct reasoning. https://dev.openwrt.org/browser/trunk/target/linux/generic/patches-3.18/411-mtd-partial_eraseblock_write.patch I propose that the message class is changed from a kernel warning to a kernel info message and the text is changed to be less scary: 'partition "kernel" is read-only: it does not start and end at erase block boundary and is larger than a single block' [ 2.970000] 2 netgear-fw partitions found on MTD device firmware [ 2.970000] 0x000000070000-0x000000188440 : "kernel" [ 2.980000] mtd: partition "kernel" is read-only: it does not start and end at erase block boundary and is larger than a single block [ 2.990000] 0x000000188440-0x000000ff0000 : "rootfs" [ 2.990000] mtd: partition "rootfs" is read-only: it does not start and end at erase block boundary and is larger than a single block I would prefer to shorten the message even more, but I didn't invent a suitable short but informative wording. (Althoug as this is currently most often just an informative notice, I am not quite sure if the logic needs to be explained quite that closely in the message.) Signed-off-by: Hannu Nyman --- target/linux/generic/patches-3.18/411-mtd-partial_eraseblock_write.patch +++ target/linux/generic/patches-3.18/411-mtd-partial_eraseblock_write.patch @@ -126,7 +126,7 @@ + slave->mtd.erasesize = slave->mtd.size; } + if ((slave->mtd.flags & (MTD_ERASE_PARTIAL|MTD_WRITEABLE)) == MTD_ERASE_PARTIAL) -+ printk(KERN_WARNING"mtd: partition \"%s\" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only\n", ++ printk(KERN_INFO"mtd: partition \"%s\" is read-only: it does not start and end at erase block boundary and is larger than a single block\n", + part->name); slave->mtd.ecclayout = master->ecclayout; --- target/linux/generic/patches-4.0/411-mtd-partial_eraseblock_write.patch +++ target/linux/generic/patches-4.0/411-mtd-partial_eraseblock_write.patch @@ -126,7 +126,7 @@ + slave->mtd.erasesize = slave->mtd.size; } + if ((slave->mtd.flags & (MTD_ERASE_PARTIAL|MTD_WRITEABLE)) == MTD_ERASE_PARTIAL) -+ printk(KERN_WARNING"mtd: partition \"%s\" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only\n", ++ printk(KERN_INFO"mtd: partition \"%s\" is read-only: it does not start and end at erase block boundary and is larger than a single block\n", + part->name); slave->mtd.ecclayout = master->ecclayout;