Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2329235ybc; Wed, 13 Nov 2019 12:39:59 -0800 (PST) X-Google-Smtp-Source: APXvYqx1lkAG/m+LEKvKc461RG45WKzHPt3cWRsqa2BT+FNPTPa7fq1gTNLXpA9GxBlFx15BpL7Y X-Received: by 2002:a50:becf:: with SMTP id e15mr5845548edk.135.1573677599242; Wed, 13 Nov 2019 12:39:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573677599; cv=none; d=google.com; s=arc-20160816; b=TfjSJWWyfLUxI5nD9cKUQIKMNpA/eTVFuM1oMVFguU5m5jTh5zKITqgzh6og1A1eL8 ZL+6yMxSsJSRORG5BNaRJXYiN6ghE/fFH+gUuHKls8hoQPL+YH5OGBvXfsSx1aUmTwZq xUU0DB08QbGaL863eUtvnPHgPg1xcwqZwJnXxhPSDGjuC0wvl5tA7qQ95PcFcPj2siAF TzTHpy1jlJDa3iGY/8zhhcEUnS3+ULHlEMaCJJC4bptoF419dqo1tq3vXOTUJdzIa7aA 3YSxuL0Q/Ns/qXYKDCWP326Dwfv7Ehm3u3+ICKJ7yfKXWxxgIASOHmBouhmXwvlLF+3K g8ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YxcRlNzcBiAlNudn6kLat8m1vGtNWaR0Jl7FMyM2EN0=; b=wTWIFk2vfwxMAFmHYFr4wjvB/Y2EYcuT2AysgkZ9A0e4kvMRVjMAes8Li+HbK/NhN7 DKeYDJUm5PAC8+e5DhmIzZg2WrUJrF8G7+67EtaIHyLX4pdAA5eZeSg89IFGT5g1QGvP 5dHnj8NZhucFgovNlaKGQXygv+xsZcSvV7UmXshKjo83nDGomZNHBvlerAZgZ+qNGUQV GYU1oHP5EmQWdUCSFwLLY9e+MfmagzaWqNUWGaoNhB0/BlGIqdakO+nmsLHDR1eKVDFs kcSJzfWyHzopLHK6Kbr8FZj0XixHd9JSc2enX74+fR2KVtIj1UZ4FxttEQlVBJAh7ScO Gj4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=umNxMXgm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z35si2560892edz.260.2019.11.13.12.39.34; Wed, 13 Nov 2019 12:39:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=umNxMXgm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbfKMUiv (ORCPT + 99 others); Wed, 13 Nov 2019 15:38:51 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:44183 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726162AbfKMUiu (ORCPT ); Wed, 13 Nov 2019 15:38:50 -0500 Received: by mail-io1-f66.google.com with SMTP id j20so4073877ioo.11; Wed, 13 Nov 2019 12:38:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YxcRlNzcBiAlNudn6kLat8m1vGtNWaR0Jl7FMyM2EN0=; b=umNxMXgm8tIXimc6Ozqie+Gdq82fKd0dw3loWE9SmGvZAEvk9fJbiRnYW0NFTikUTG AOjEZDGuo6/TiRCPGgN68PH+TcYITjdsx3AcWZn/LTfuYDGh47Dlm2+jNYfaOHz1B+rn lh+5DE24bJugrp5ewgePSfZ2sFYuUCjLtxeJHa9LmOFcHA0/FvWGTw5rPGKb6YRTOiNT 6F6uV/lMfmyuYvJ0HkxxSGTZfT4TADggleQ578z3uQzjueYa2Y9mRQ+pzkA4N2QCvCT1 0JXRsA3pCFDDhBzpFcxtVHFmHbHddlGxGyo//LyBa6rA3QYAa49hiNhO/Ef7HakKmvBC tReA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YxcRlNzcBiAlNudn6kLat8m1vGtNWaR0Jl7FMyM2EN0=; b=GVHMqLJrSVzpKfc5cIimfhn6FdoCqjiUev6OHGhNRDyYJ2liZrfgBWhSTTpOKQ6L7C ge2I+rdDeBh3vJNOeeXBeGlr63W4UkqPYp31IFgf1zTSIr1Ug45oQXB6xJodCbphxDRr 0zPUZFYpaYSz3QPk4COTq7BvEViH2JTqYf5r+rhaO9TwGdhprrXpm2ovHbqmGFQ99pc7 kycInqWYStqb2pRZTpoksXPHnHKuFpYzguWku1MIInmc3JRywx6jxgdNTYPclzuBbYsu Y+lcnJZ8z25FBNuyTKlQUz41jnY9bZ3albhtJoa0mMjaUVg+Uzg+uu3LV7OEc1GP9g+i dSdw== X-Gm-Message-State: APjAAAVlQ+Q5uh3WwbVzNLqepXtvf8wYW3jR10CNrL7p482V2I+C+FoY LDItD01V/SeqjNY+lM3yZn580+NeCjuqtRxfUXiTVuQU X-Received: by 2002:a5d:8789:: with SMTP id f9mr5317745ion.237.1573677528331; Wed, 13 Nov 2019 12:38:48 -0800 (PST) MIME-Version: 1.0 References: <156950767876.30879.17024491763471689960.stgit@warthog.procyon.org.uk> In-Reply-To: From: Han Xu Date: Wed, 13 Nov 2019 14:38:37 -0600 Message-ID: Subject: Re: [PATCH] jffs2: Fix mounting under new mount API To: Sergei Shtylyov Cc: David Howells , David Woodhouse , Richard Weinberger , linux-fsdevel@vger.kernel.org, linux-mtd , viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tested the JFFS2 on 5.4 kernel as the instruction said, still got some errors, any ideas? Without the patch, root@imx8mmevk:~# cat /proc/mtd dev: size erasesize name mtd0: 00400000 00020000 "mtdram test device" mtd1: 04000000 00020000 "5d120000.spi" root@imx8mmevk:~# mtd_debug info /dev/mtd0 mtd.type = MTD_RAM mtd.flags = MTD_CAP_RAM mtd.size = 4194304 (4M) mtd.erasesize = 131072 (128K) mtd.writesize = 1 mtd.oobsize = 0 regions = 0 root@imx8mmevk:~# flash_erase /dev/mtd0 0 0 Erasing 128 Kibyte @ 3e0000 -- 100 % complete root@imx8mmevk:~# mount -t jffs2 /dev/mtdblock0 test_dir/ mount: /home/root/test_dir: wrong fs type, bad option, bad superblock on /dev/mtdblock0, missing codepage or helper program, or other error. With the patch, root@imx8mmevk:~# cat /proc/mtd dev: size erasesize name mtd0: 00400000 00020000 "mtdram test device" mtd1: 04000000 00020000 "5d120000.spi" root@imx8mmevk:~# mtd_debug info /dev/mtd0 mtd.type = MTD_RAM mtd.flags = MTD_CAP_RAM mtd.size = 4194304 (4M) mtd.erasesize = 131072 (128K) mtd.writesize = 1 mtd.oobsize = 0 regions = 0 root@imx8mmevk:~# flash_erase /dev/mtd0 0 0 Erasing 128 Kibyte @ 3e0000 -- 100 % complete root@imx8mmevk:~# mount -t jffs2 /dev/mtdblock0 test_dir/ root@imx8mmevk:~# mount /dev/mtdblock0 on /home/root/test_dir type jffs2 (rw,relatime) BUT, it's not writable. root@imx8mmevk:~# cp test_file test_dir/ cp: error writing 'test_dir/test_file': Invalid argument root@imx8mmevk:~# dd if=/dev/urandom of=test_dir/test_file bs=1k count=1 dd: error writing 'test_dir/test_file': Invalid argument 1+0 records in 0+0 records out 0 bytes copied, 0.000855156 s, 0.0 kB/s On Fri, Sep 27, 2019 at 3:38 AM Sergei Shtylyov wrote: > > Hello! > > On 26.09.2019 17:21, David Howells wrote: > > > The mounting of jffs2 is broken due to the changes from the new mount API > > because it specifies a "source" operation, but then doesn't actually > > process it. But because it specified it, it doesn't return -ENOPARAM and > > What specified what? Too many "it"'s to figure that out. :-) > > > the caller doesn't process it either and the source gets lost. > > > > Fix this by simply removing the source parameter from jffs2 and letting the > > VFS deal with it in the default manner. > > > > To test it, enable CONFIG_MTD_MTDRAM and allow the default size and erase > > block size parameters, then try and mount the /dev/mtdblock file that > > that creates as jffs2. No need to initialise it. > > One "that" should be enough. :-) > > > Fixes: ec10a24f10c8 ("vfs: Convert jffs2 to use the new mount API") > > Reported-by: Al Viro > > Signed-off-by: David Howells > > cc: David Woodhouse > > cc: Richard Weinberger > > cc: linux-mtd@lists.infradead.org > [...] > > MBR, Sergei > > ______________________________________________________ > Linux MTD discussion mailing list > http://lists.infradead.org/mailman/listinfo/linux-mtd/ -- Sincerely, Han XU