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=-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 3D397C4338F for ; Wed, 11 Aug 2021 12:17:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1514D60FC0 for ; Wed, 11 Aug 2021 12:17:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237382AbhHKMR4 (ORCPT ); Wed, 11 Aug 2021 08:17:56 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:8010 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbhHKMRz (ORCPT ); Wed, 11 Aug 2021 08:17:55 -0400 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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) { /* -- 2.31.1