Re: [PATCH 6/6] z_erofs_pcluster_begin(): don't bother with rounding position down

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Al,

On 2024/4/26 04:00, Al Viro wrote:
... and be more idiomatic when calculating ->pageofs_in.

Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
---
  fs/erofs/zdata.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index d417e189f1a0..a4ff20b54cc1 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -868,7 +868,7 @@ static int z_erofs_pcluster_begin(struct z_erofs_decompress_frontend *fe)
  	} else {
  		void *mptr;
- mptr = erofs_read_metabuf(&map->buf, sb, erofs_pos(sb, blknr), EROFS_NO_KMAP);
+		mptr = erofs_read_metabuf(&map->buf, sb, map->m_pa, EROFS_NO_KMAP);

This patch caused some corrupted failure, since
here erofs_read_metabuf() is EROFS_NO_KMAP and
it's no needed to get a maped-address since only
a page reference is needed.

  		if (IS_ERR(mptr)) {
  			ret = PTR_ERR(mptr);
  			erofs_err(sb, "failed to get inline data %d", ret);
@@ -876,7 +876,7 @@ static int z_erofs_pcluster_begin(struct z_erofs_decompress_frontend *fe)
  		}
  		get_page(map->buf.page);
  		WRITE_ONCE(fe->pcl->compressed_bvecs[0].page, map->buf.page);
-		fe->pcl->pageofs_in = map->m_pa & ~PAGE_MASK;
+		fe->pcl->pageofs_in = offset_in_page(mptr);

So it's unnecessary to change this line IMHO.

BTW, would you mind routing this series through erofs tree
with other erofs patches for -next (as long as this series
isn't twisted with vfs and block stuffs...)?  Since I may
need to test more to ensure they don't break anything and
could fix them immediately by hand...

Thanks,
Gao Xiang


  		fe->mode = Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE;
  	}
  	/* file-backed inplace I/O pages are traversed in reverse order */




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux