From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24FB71FCCEE for ; Fri, 17 Jan 2025 09:55:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737107719; cv=none; b=hBCGGz3Z8i72aqeW8ASkKmOFcir7WgW5yttQ0u+u5lNP7Ff8TMcB/3tXX4QlbJDfStjAZWRYNH10YzlPiWpc4Me5qlcxRzac/ukOPKWhxESMm2pwXu4PV+8ceE3fshfqmALEdiCTBwTW+rIWcMQGqEeJd8RpTUmYLP54hwTxt0A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737107719; c=relaxed/simple; bh=F92lQbPQ5u8vJg3RIkYgBc1nHDJ1NEBwZwF2qkRZ93k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TDzmIjVM6rMms3MH8ft2dxOKrHKEgjpG7WKaU21wIcGu2mJ6H7AeucOTO50M5A3ZDMmPIMPxzE5at2XSlyl02rL41ZKEnQApmofU68OZpxwxO5Sg7CUxZjbW6aPHZWE9FXJr/jpKnEevyxrSJipCa7qzjqo2OgQ5vnQC5Pkh9Mg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=Q/eu8XXR; arc=none smtp.client-ip=115.124.30.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="Q/eu8XXR" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1737107709; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=Zgm57csXe3ohMYeCjXJ+yP1UaNYXfvtgJfFAoTH8JaM=; b=Q/eu8XXRQDlsbLeJRhWlv4h90l4EbWykFdHnkJHAs4fHknJP2YBbR11QGAU78yLP9B3WiGPeRFEThqrDRNWthT3c6zM4jp5vOhCOPN1dErhHAt5+AEhOSNdSbr0oVQ9lxWiU2Bc2SPbcqUakdcAsQnMenyBNCgh71FlVGE3BfDw= Received: from 30.41.10.74(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WNoQt0I_1737107700 cluster:ay36) by smtp.aliyun-inc.com; Fri, 17 Jan 2025 17:55:08 +0800 Message-ID: <58cadb57-22ce-4818-af2b-9ae452c38f27@linux.alibaba.com> Date: Fri, 17 Jan 2025 17:54:59 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] erofs: add error log in erofs_fc_parse_param To: Chen Linxuan , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale Cc: linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <649afa9b-5724-4b52-8b9b-9a82a3c1468b@linux.alibaba.com> <640C401CAB291F86+ffb78b4f37e75faf2b4730e625b8d72d15be782a.camel@uniontech.com> From: Gao Xiang In-Reply-To: <640C401CAB291F86+ffb78b4f37e75faf2b4730e625b8d72d15be782a.camel@uniontech.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025/1/17 17:50, Chen Linxuan wrote: > On Fri, 2025-01-17 at 17:28 +0800, Gao Xiang wrote: >> Hi Linxuan, >> >> On 2025/1/17 16:52, Chen Linxuan wrote: >>> While reading erofs code, I notice that `erofs_fc_parse_param` will >>> return -ENOPARAM, which means that erofs do not support this option, >>> without report anything when `fs_parse` return an unknown `opt`. >>> >>> But if an option is unknown to erofs, I mean that option not in >>> `erofs_fs_parameters` at all, `fs_parse` will return -ENOPARAM, >>> which means that `erofs_fs_parameters` should has returned earlier. >>> >>> Entering `default` means `fs_parse` return something we unexpected. >>> I am not sure about it but I think we should return -EINVAL here, >>> just like `xfs_fs_parse_param`. >>> >>> Signed-off-by: Chen Linxuan >> >> I think the default branch is actually deadcode here, see >> erofs_fc_parse_param() -> fs_parse() -> fs_lookup_key() -> -ENOPARAM >> >> then vfs_parse_fs_param() will show "Unknown parameter". >> >> Maybe we could just kill `default:` branch... > > ext4 do not have a `default:` branch, but xfs return -EINVAL. > > I think `default:` branch can report error when `fs_parse` or > `erofs_fs_parameters` goes wrong. How can it go wrong? Thanks, Gao Xiang