linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Liu Bo <bo.liu@linux.alibaba.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: linux-erofs@lists.ozlabs.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] erofs: fix misbehavior of unsupported chunk format check
Date: Thu, 23 Sep 2021 01:48:56 +0800	[thread overview]
Message-ID: <20210922174856.GA87201@rsjd01523.et2sqa> (raw)
In-Reply-To: <20210922095141.233938-1-hsiangkao@linux.alibaba.com>

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 <bo.liu@linux.alibaba.com>

thanks,
liubo

> Fixes: c5aa903a59db ("erofs: support reading chunk-based uncompressed files")
> Cc: Liu Bo <bo.liu@linux.alibaba.com>
> Cc: Chao Yu <chao@kernel.org>
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
> ---
>  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

  reply	other threads:[~2021-09-22 17:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22  9:51 [PATCH] erofs: fix misbehavior of unsupported chunk format check Gao Xiang
2021-09-22 17:48 ` Liu Bo [this message]
2021-09-23 15:09 ` Chao Yu
2021-09-23 15:19   ` Gao Xiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210922174856.GA87201@rsjd01523.et2sqa \
    --to=bo.liu@linux.alibaba.com \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).