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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=unavailable 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 2412BC433EF for ; Wed, 22 Sep 2021 17:49:25 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 586D1611CA for ; Wed, 22 Sep 2021 17:49:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 586D1611CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HF5QW0B7Tz2yPd for ; Thu, 23 Sep 2021 03:49:23 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.57; helo=out30-57.freemail.mail.aliyun.com; envelope-from=bo.liu@linux.alibaba.com; receiver=) Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HF5QQ4Gwqz2xYN for ; Thu, 23 Sep 2021 03:49:12 +1000 (AEST) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R741e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04395; MF=bo.liu@linux.alibaba.com; NM=1; PH=DS; RN=4; SR=0; TI=SMTPD_---0UpFichl_1632332936; Received: from rsjd01523.et2sqa(mailfrom:bo.liu@linux.alibaba.com fp:SMTPD_---0UpFichl_1632332936) by smtp.aliyun-inc.com(127.0.0.1); Thu, 23 Sep 2021 01:49:03 +0800 Date: Thu, 23 Sep 2021 01:48:56 +0800 From: Liu Bo To: Gao Xiang Subject: Re: [PATCH] erofs: fix misbehavior of unsupported chunk format check Message-ID: <20210922174856.GA87201@rsjd01523.et2sqa> References: <20210922095141.233938-1-hsiangkao@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210922095141.233938-1-hsiangkao@linux.alibaba.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: bo.liu@linux.alibaba.com Cc: linux-erofs@lists.ozlabs.org, LKML Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Wed, Sep 22, 2021 at 05:51:41PM +0800, Gao Xiang wrote: > Unsupported chunk format should be checked with > "if (vi->chunkformat & ~EROFS_CHUNK_FORMAT_ALL)" > > Found when checking with 4k-byte blockmap (although currently mkfs > uses inode chunk indexes format by default.) > Good catch. Reviewed-by: Liu Bo thanks, liubo > Fixes: c5aa903a59db ("erofs: support reading chunk-based uncompressed files") > Cc: Liu Bo > Cc: Chao Yu > Signed-off-by: Gao Xiang > --- > fs/erofs/inode.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c > index 31ac3a7..a552399 100644 > --- a/fs/erofs/inode.c > +++ b/fs/erofs/inode.c > @@ -176,7 +176,7 @@ static struct page *erofs_read_inode(struct inode *inode, > } > > if (vi->datalayout == EROFS_INODE_CHUNK_BASED) { > - if (!(vi->chunkformat & EROFS_CHUNK_FORMAT_ALL)) { > + if (vi->chunkformat & ~EROFS_CHUNK_FORMAT_ALL) { > erofs_err(inode->i_sb, > "unsupported chunk format %x of nid %llu", > vi->chunkformat, vi->nid); > -- > 1.8.3.1