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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 79816C433EF for ; Fri, 24 Sep 2021 04:35:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A73061100 for ; Fri, 24 Sep 2021 04:35:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243585AbhIXEgz (ORCPT ); Fri, 24 Sep 2021 00:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242223AbhIXEgu (ORCPT ); Fri, 24 Sep 2021 00:36:50 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBAD4C061574 for ; Thu, 23 Sep 2021 21:35:16 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTcvS-006r8Z-Mj; Fri, 24 Sep 2021 04:35:06 +0000 Date: Fri, 24 Sep 2021 04:35:06 +0000 From: Al Viro To: yangerkun Cc: akpm@linux-foundation.org, jack@suse.cz, gregkh@linuxfoundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, yukuai3@huawei.com Subject: Re: [PATCH] ramfs: fix mount source show for ramfs Message-ID: References: <20210811122811.2288041-1-yangerkun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210811122811.2288041-1-yangerkun@huawei.com> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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. 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) { > /* Umm... If anything, I would rather call that thing *after* fs_parse() gives negative, similar to what kernel/cgroup/cgroup-v1.c does.