Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp316386pxb; Wed, 22 Sep 2021 02:54:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVdByTwNeK3gSXInnD9S8eM0OHNXp6G9lcT1exf6OjLTxT54GtDx3TYoYOyl+o9tJBSQNz X-Received: by 2002:a6b:fe05:: with SMTP id x5mr3541276ioh.26.1632304445519; Wed, 22 Sep 2021 02:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632304445; cv=none; d=google.com; s=arc-20160816; b=qaDLAnwVJGbWYBZvwB3hYEFiyDRQyFuw9gdR8TqGYOZWOE8B0YfsPle27j7OZANc5p KlnsI/386AmikGlHastdsw7X3xZDhxzoaUipcJIH1ney4WfPGD//0wIyCmrcRg97anGE pJO2eawcd/CzxbOOx59KX2bVpemEP9gl515u7t8XD4VUz9idhLJwzZh3yDydwM52P0fX YiH57g+I17BylbLcG3Jroboz3YLmg+LhI9GqgAgJxiasQ+P8Fq0P60IkILwE1uIMVP7M PnNaAydkAEgIDlc8uwVUkbSyDvMqgTZu+UqZrVsyKF1w6pPgJLJ6fXdmrDtVmiv3yPeb 97Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=BQnvYtkn3Znx3ycvVHfnllIAgouFyUCzKHr6mmIVs5g=; b=WWxAxs1RR4u4JIXxBfSoNKyFKRS7j386NNDpGrKKY8l8qMIKwNt5KDvbelCJHRIrGH fqVa8kb/cdMdRso7rM5xnrwruTxA4YPeKERFkb1ejVxeZj0xrBcdQ0rz3ARb2SDAZj7J Q51KuwhtdJcAdBR0fDMsmRdzGhlP9Ky9EHSpfzv5sfNzFGcSfRBp7eqB7gkjnp1uUv1f Kgd6Q/ewhJsC7uD4rfNYgZFnxIel8Yi84crfkPfqQIkHrEDawfXYGrdaR15M9vJdjsuf HhJS/pWWILu9wXNUF1yudvuED2ESCerXfJSGi1M44kTre+Zii9JwvS4wbI6le0UVcK9S F9Hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q20si2176054ilg.117.2021.09.22.02.53.54; Wed, 22 Sep 2021 02:54:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234414AbhIVJxY (ORCPT + 99 others); Wed, 22 Sep 2021 05:53:24 -0400 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:37285 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234233AbhIVJxX (ORCPT ); Wed, 22 Sep 2021 05:53:23 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R941e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0UpDev3j_1632304305; Received: from e18g09479.et15sqa.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0UpDev3j_1632304305) by smtp.aliyun-inc.com(127.0.0.1); Wed, 22 Sep 2021 17:51:52 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org, Chao Yu , Liu Bo Cc: LKML , Gao Xiang Subject: [PATCH] erofs: fix misbehavior of unsupported chunk format check Date: Wed, 22 Sep 2021 17:51:41 +0800 Message-Id: <20210922095141.233938-1-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.24.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.) 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