From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42355C433EF for ; Fri, 24 Sep 2021 07:53:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C84C860F3A for ; Fri, 24 Sep 2021 07:53:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C84C860F3A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 260276B006C; Fri, 24 Sep 2021 03:53:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 20F4D6B0071; Fri, 24 Sep 2021 03:53:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FDBE900002; Fri, 24 Sep 2021 03:53:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0090.hostedemail.com [216.40.44.90]) by kanga.kvack.org (Postfix) with ESMTP id 0481E6B006C for ; Fri, 24 Sep 2021 03:53:49 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9F9598249980 for ; Fri, 24 Sep 2021 07:53:48 +0000 (UTC) X-FDA: 78621702936.08.AF98D20 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf29.hostedemail.com (Postfix) with ESMTP id E17EC9000249 for ; Fri, 24 Sep 2021 07:53:47 +0000 (UTC) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HG41Q6DZXzbmlh; Fri, 24 Sep 2021 15:49:30 +0800 (CST) Received: from dggema766-chm.china.huawei.com (10.1.198.208) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.8; Fri, 24 Sep 2021 15:53:44 +0800 Received: from [10.174.177.210] (10.174.177.210) by dggema766-chm.china.huawei.com (10.1.198.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Fri, 24 Sep 2021 15:53:43 +0800 Message-ID: Date: Fri, 24 Sep 2021 15:53:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH] ramfs: fix mount source show for ramfs To: Al Viro CC: , , , , , References: <20210811122811.2288041-1-yangerkun@huawei.com> From: yangerkun In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed X-Originating-IP: [10.174.177.210] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggema766-chm.china.huawei.com (10.1.198.208) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E17EC9000249 X-Stat-Signature: qbus45y8oryu9yc1ek4ef8kw4cnosao8 Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of yangerkun@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=yangerkun@huawei.com X-HE-Tag: 1632470027-501236 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000019, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: =E5=9C=A8 2021/9/24 12:35, Al Viro =E5=86=99=E9=81=93: > On Wed, Aug 11, 2021 at 08:28:11PM +0800, yangerkun wrote: >> ramfs_parse_param does not parse key "source", and will convert >> -ENOPARAM to 0. This will skip vfs_parse_fs_param_source in >> vfs_parse_fs_param, which lead always "none" mount source for ramfs. F= ix >> it by parse "source" in ramfs_parse_param. >> >> Signed-off-by: yangerkun >> --- >> fs/ramfs/inode.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c >> index 65e7e56005b8..0d7f5f655fd8 100644 >> --- a/fs/ramfs/inode.c >> +++ b/fs/ramfs/inode.c >> @@ -202,6 +202,10 @@ static int ramfs_parse_param(struct fs_context *f= c, struct fs_parameter *param) >> struct ramfs_fs_info *fsi =3D fc->s_fs_info; >> int opt; >> =20 >> + opt =3D vfs_parse_fs_param_source(fc, param); >> + if (opt !=3D -ENOPARAM) >> + return opt; >> + >> opt =3D fs_parse(fc, ramfs_fs_parameters, param, &result); >> if (opt < 0) { >> /* >=20 > Umm... If anything, I would rather call that thing *after* > fs_parse() gives negative, similar to what kernel/cgroup/cgroup-v1.c > does. Thanks for your advise. Will do it next version. > . >=20