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 29278143759 for ; Sat, 18 Jan 2025 08:45:38 +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=1737189942; cv=none; b=RHRSrdMHzFl6g/wkHR2ikSbSqct4thstcRzqtHTJ9eB7bnI0vcIwn+UUQwwpxYVw04eob232i+pFHTKW99/kc49MYUVB9z460WEkxgMorOjoBPBIvvM4ukHq3oxGVz8iSxix2KsR9k8AqZN15rKP/MFx1v5MX3TOP4OxoxedQJQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737189942; c=relaxed/simple; bh=0vbLnIbCCP2jhy9MbeBOpZe3KMeeV1L19lv9CL1KNJA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jMaovJpkE2b4a4bmk/HZeWxYZoarvzVnhjtbWgNVW0bhko0FuyDspGpKghmLCql5R1GLpqfQkETciJHW9jt5FlW5AHBbHr9vuKw2++KmudYWnFqekArkZjfOQI8p4ENp44crMTUADPcWI0VglT5QFbIts2Py1DyGcLkStIEF0bA= 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=mqNh2VEc; 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="mqNh2VEc" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1737189936; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=ZnvZSifxCETy8EEzGo2CJYfb5AGXRfCxO5lzIAjsPMo=; b=mqNh2VEcx8riZRy+xU3KgjXQu0d0U3ytXHiISlsMvwhM0rWACYZgwf817kqsPjxhju7dfAetJJVrqLp3eqytMz26/oeAL4T3NBkshKuV+GnrR8/4A/Cy5NfE5bHsfsh2pxf+V1XLPmvBV/qZA6YAwLXR0MHVC8S72WN70vr2jLA= Received: from 30.41.10.74(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WNr.S61_1737189927 cluster:ay36) by smtp.aliyun-inc.com; Sat, 18 Jan 2025 16:45:35 +0800 Message-ID: <963f880b-826f-4276-a73e-da5fdd02a6ae@linux.alibaba.com> Date: Sat, 18 Jan 2025 16:45:26 +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: Ian Kent , Chen Linxuan , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale Cc: linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <9b2b5a34-cddd-41b2-9d1e-939b9f97b44b@themaw.net> From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025/1/18 09:25, Ian Kent wrote: > On 18/1/25 08:45, Ian Kent wrote: >> On 17/1/25 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. >> >> I'm pretty sure than the vfs deals with reporting unknown options >> >> and returns -EINVAL already. >> >> >> I think the caller oferofs_fc_parse_param() is vfs_parse_fs_param() >> >> and for an -ENOPARAM return will ultimately do this: >> >> return invalf(fc, "%s: Unknown parameter '%s'", fc->fs_type->name, param->key); >> >> which does this. >> >> The thing about this is the mount API macro deals with (or it should, >> >> although I'm not sure that's completely sorted out yet) logging the >> >> message to the console log as well as possibly making it available to >> >> mount api system calls. I'm pretty sure this change will prevent the >> >> error message being available for mount api system calls to retrieve. > > Actually no, removing the default switch branch does look like the right thing > > to do, my mistake. The call to fs_parse() will return -NOPARAM so the > > switch doesn't need to handle that case. > > > Oops! Yeah, actually dead code.. Thanks, Gao Xiang > >> >> Ian >> >>>