From patchwork Wed Aug 11 12:28:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yangerkun X-Patchwork-Id: 12431041 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 D6D2BC4320A for ; Wed, 11 Aug 2021 12:17:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6A48460FC0 for ; Wed, 11 Aug 2021 12:17:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6A48460FC0 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 D14B76B0071; Wed, 11 Aug 2021 08:17:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC5676B0072; Wed, 11 Aug 2021 08:17:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB3398D0001; Wed, 11 Aug 2021 08:17:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0046.hostedemail.com [216.40.44.46]) by kanga.kvack.org (Postfix) with ESMTP id 9E69E6B0071 for ; Wed, 11 Aug 2021 08:17:34 -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 34AFC824999B for ; Wed, 11 Aug 2021 12:17:34 +0000 (UTC) X-FDA: 78462700428.08.0ACF292 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf23.hostedemail.com (Postfix) with ESMTP id 69885900CFA5 for ; Wed, 11 Aug 2021 12:17:33 +0000 (UTC) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Gl82g017LzYjSZ; Wed, 11 Aug 2021 20:17:15 +0800 (CST) Received: from dggema766-chm.china.huawei.com (10.1.198.208) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Wed, 11 Aug 2021 20:17:30 +0800 Received: from localhost.localdomain (10.175.127.227) 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.2176.2; Wed, 11 Aug 2021 20:17:29 +0800 From: yangerkun To: CC: , , , , , , Subject: [PATCH] ramfs: fix mount source show for ramfs Date: Wed, 11 Aug 2021 20:28:11 +0800 Message-ID: <20210811122811.2288041-1-yangerkun@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggema766-chm.china.huawei.com (10.1.198.208) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 69885900CFA5 Authentication-Results: imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of yangerkun@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=yangerkun@huawei.com; dmarc=pass (policy=none) header.from=huawei.com X-Stat-Signature: wbmr7gjf6aa7nd6bgdgps375mpedjx34 X-HE-Tag: 1628684253-403904 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Fix 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 *fc, struct fs_parameter *param) struct ramfs_fs_info *fsi = fc->s_fs_info; int opt; + opt = vfs_parse_fs_param_source(fc, param); + if (opt != -ENOPARAM) + return opt; + opt = fs_parse(fc, ramfs_fs_parameters, param, &result); if (opt < 0) { /*