lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c1a59a9b-2fc1-426e-99e0-26380fcbb4de@linux.alibaba.com>
Date: Fri, 7 Feb 2025 17:10:51 +0800
From: Gao Xiang <hsiangkao@...ux.alibaba.com>
To: Hongbo Li <lihongbo22@...wei.com>,
 Hongzhen Luo <hongzhen@...ux.alibaba.com>, linux-erofs@...ts.ozlabs.org
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] erofs: use Z_EROFS_LCLUSTER_TYPE_MAX to simplify
 switches

Hi Hongbo,

On 2025/2/7 16:57, Hongbo Li via Linux-erofs wrote:
> 

...

>>> @@ -329,35 +328,31 @@ static int z_erofs_get_extent_compressedlen(struct z_erofs_maprecorder *m,
>>>       DBG_BUGON(lcn == initial_lcn &&
>>>             m->type == Z_EROFS_LCLUSTER_TYPE_NONHEAD);
>>> -    switch (m->type) {
>>> -    case Z_EROFS_LCLUSTER_TYPE_PLAIN:
>>> -    case Z_EROFS_LCLUSTER_TYPE_HEAD1:
>>> -    case Z_EROFS_LCLUSTER_TYPE_HEAD2:
>>> +    if (m->type >= Z_EROFS_LCLUSTER_TYPE_MAX) {
>>> +        erofs_err(sb, "cannot found CBLKCNT @ lcn %lu of nid %llu", lcn, vi->nid);
>>> +        DBG_BUGON(1);
>>> +        return -EFSCORRUPTED;
>>> +    }
>>
>> No, I don't think it's equivalent, please use
>> the previous version for this part instead.
> 
> I think this version doesn't consider the fallthrough case. May be just use the goto statement can keep equivalent.

For this particular part, I tend to use the first
version since it's already simple enough anyway.

Thanks,
Gao Xiang

> 
> Thanks,
> Hongbo
> 
>>
>> Thanks,
>> Gao Xiang


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ