Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp700392pxb; Wed, 22 Sep 2021 10:50:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0Cv3Suim4bQgB8425V4yG/3YBuLiQBY1l0TnyIC4bwxY88FOfEVQDqYw1vevPXd4hruZb X-Received: by 2002:a05:6e02:f44:: with SMTP id y4mr215207ilj.37.1632333014448; Wed, 22 Sep 2021 10:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632333014; cv=none; d=google.com; s=arc-20160816; b=OFjYcMGyEFbFGT+hE4ChDeMvsj1wmCSwAz5fgslPEfp6A8J2Gio4sDfO6HcF9Ptn+D mU3E5hfS0pMyl6R5SO6uuygTrz0bwxVoOSf41FTAbbs3Ya5d7PJdNjkjbbLVaeH+tN1G NbzuMbtQz/GYaGSBSD27k764fQ510voKf7jMGPgEzuC6J2xQJ+5+7Pa7+p57vwSZfr96 /m2pI/dxOZQAW8JwaoEEWExRfLzAgxhPcOKVjtb2a7pUsT6U7n162EcCmzeIhRrMCroj 7wB35/ABnAsPxy2hJXd5SlDBs3zMeeqH63YGIRkVX7Ys3uN04oE/ceAi8VjAVKSdIbUg cvuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date; bh=hKfUeoRWoh7eGdnUAO2iZDHzMiCu4y7I5A0e4NVw1yk=; b=E6F2VNB3buy7jUww4m9hueL0HZErEECf0r8vLSZ+s3OxOD/8u4d0B2q3HyLVpgATBR MFQcrt0HyPHkkvxa9nv7Z1WiFAK4YTpcQd9UJunET16Pr7IQ9lpmq6I9kR6dAl1JOjVe 5HKJw5xj78EXv5JGOlQqz9gs//Qy9BRZUnMa5rVhQtST3k59ZXOZv+Z2ff87vtNIk4ax RneDeD5hKeHUeAZKIzBeuC5w+KehkQZTv2ejUYVHRHUbMfX79ggtHX0fNWT1AzP5HD3b iJqHe35dBT1IKi+WHU7zf+hGrOA4cusvbyVsZcfpGiSxPtJaIy3cqKb/BtlfBU2c3y5e vlUw== 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 i3si3335321ila.152.2021.09.22.10.50.00; Wed, 22 Sep 2021 10:50:14 -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 S236837AbhIVRug (ORCPT + 99 others); Wed, 22 Sep 2021 13:50:36 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:48361 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233552AbhIVRuf (ORCPT ); Wed, 22 Sep 2021 13:50:35 -0400 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 Cc: linux-erofs@lists.ozlabs.org, Chao Yu , LKML Subject: Re: [PATCH] erofs: fix misbehavior of unsupported chunk format check Message-ID: <20210922174856.GA87201@rsjd01523.et2sqa> Reply-To: bo.liu@linux.alibaba.com 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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