From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) (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 2258422A4E1 for ; Thu, 18 Dec 2025 03:25:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766028357; cv=none; b=Hng5b12w7plAoPfSDzAE6Jo/5skgsaX2wh00udhLqaxw9SOPC7dlcWJVN4plvONLNxgbnbXaZIqG2YqthCshEhOuvNCdj3s1UFTvydvG/eYMq3ki0DvqE0pSrYRTjnjQf6Mg/Nq3BSNcBGgO3BLNXm1uCLZvCq3Hb/4XnVW9JoQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766028357; c=relaxed/simple; bh=s/Ayl6bVj64118hFPKOknq2uKLHjQBSyCkPylT3I/Zg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PD7vtZmDIMOfgtVFF17IHbDMtRpt3RWtXty3O0QAg9DItquf8Z2nRKIfO1TSstVs79x/B0wB5ZkUS/TFXKQnWLt7uWy8cWV/eAZZT0CONElbrX0C7el6eA2rJqtw6SEGZuBwZaxp9VmZa4rIZwybIyhR77u5XpQts6HBowHmYdU= 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=UiJamXC0; arc=none smtp.client-ip=115.124.30.131 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="UiJamXC0" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1766028347; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=O2r5K3ClHRUcn8V5Kxk4ANKDK0yNYHHVTlS6HFPGZOM=; b=UiJamXC00dCoy8BAAVn824/UqEHn8661spi+mF7pJpm7npKkbqLrkw3po+1p2pannqFwlp0ib2nGgesOBHoH8dANtE25dI+6ZV51Tf8Ot0/EUxmhlRxC2PBuVkFInV3GSep/9eRSs3gjtIjw+hKjv7dR6sE3YIKICXfxjtXl400= Received: from 30.221.132.6(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0Wv6mXj5_1766028346 cluster:ay36) by smtp.aliyun-inc.com; Thu, 18 Dec 2025 11:25:46 +0800 Message-ID: Date: Thu, 18 Dec 2025 11:25:45 +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: print the names of unsupported compression algorithms To: Yuwen Chen , xiang@kernel.org Cc: chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org References: From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025/12/18 11:18, Yuwen Chen wrote: > After simplifying the implementation of z_erofs_parse_cfgs, the > names of unsupported algorithms can now be directly output. > Moreover, some unnecessary additional judgments can be removed. > > Signed-off-by: Yuwen Chen It seems that you're working on outdated codebase. There is no erofs_decompressors at all. Thanks, Gao Xiang > --- > fs/erofs/decompressor.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c > index be1e19b620523..866bd9158615b 100644 > --- a/fs/erofs/decompressor.c > +++ b/fs/erofs/decompressor.c > @@ -385,21 +385,22 @@ const struct z_erofs_decompressor erofs_decompressors[] = { > .decompress = z_erofs_lz4_decompress, > .name = "lz4" > }, > -#ifdef CONFIG_EROFS_FS_ZIP_LZMA > [Z_EROFS_COMPRESSION_LZMA] = { > +#ifdef CONFIG_EROFS_FS_ZIP_LZMA > .config = z_erofs_load_lzma_config, > .decompress = z_erofs_lzma_decompress, > +#endif > .name = "lzma" > }, > -#endif > -#ifdef CONFIG_EROFS_FS_ZIP_DEFLATE > [Z_EROFS_COMPRESSION_DEFLATE] = { > +#ifdef CONFIG_EROFS_FS_ZIP_DEFLATE > .config = z_erofs_load_deflate_config, > .decompress = z_erofs_deflate_decompress, > +#endif > .name = "deflate" > }, > -#endif > }; > +static_assert(Z_EROFS_COMPRESSION_RUNTIME_MAX == ARRAY_SIZE(erofs_decompressors)); > > int z_erofs_parse_cfgs(struct super_block *sb, struct erofs_super_block *dsb) > { > @@ -433,10 +434,9 @@ int z_erofs_parse_cfgs(struct super_block *sb, struct erofs_super_block *dsb) > break; > } > > - if (alg >= ARRAY_SIZE(erofs_decompressors) || > - !erofs_decompressors[alg].config) { > - erofs_err(sb, "algorithm %ld isn't enabled on this kernel", > - alg); > + if (!erofs_decompressors[alg].config) { > + erofs_err(sb, "algorithm %s isn't enabled on this kernel", > + erofs_decompressors[alg].name); > ret = -EOPNOTSUPP; > } else { > ret = erofs_decompressors[alg].config(sb,