Skip to contentSkip to conversation

erofs-utils: fsck: support interlaced uncompressed pcluster

PATCH Superseded Yue Hu 2 participants 3 messages Dec 21, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yue Hu

author
#0 lore raw

PATCH 1/1 erofs-utils: fsck: support interlaced uncompressed pcluster

From: Yue Hu <[email protected]>

Support uncompressed data layout with on-disk interlaced offset in compression mode for fsck.erofs.

---
 fsck/main.c | 4 ++++
 1 file changed, 4 insertions(+)
fsck/main.c +4 -0
index 410e756..c2f57bc 100644
@@ -458,12 +458,16 @@ static int erofs_verify_inode_data(struct erofs_inode *inode, int outfd)
 				.in = raw,
 				.out = buffer,
 				.decodedskip = 0,
+				.interlaced_offset = 0,
 				.inputsize = map.m_plen,
 				.decodedlength = map.m_llen,
 				.alg = map.m_algorithmformat,
 				.partial_decoding = 0
 			};
 
+			if (map.m_algorithmformat == Z_EROFS_COMPRESSION_INTERLACED)
+				rq.interlaced_offset = erofs_blkoff(map.m_la);
+
 			ret = z_erofs_decompress(&rq);
 			if (ret < 0) {
 				erofs_err("failed to decompress data of m_pa %" PRIu64 ", m_plen %" PRIu64 " @ nid %llu: %s",
Signature · 1 line
2.17.1
#1 lore raw
Quoted 15 lines · Yue Hu

From: Yue Hu <[email protected]>

Support uncompressed data layout with on-disk interlaced offset in compression mode for fsck.erofs.

---
 fsck/main.c | 4 ++++
 1 file changed, 4 insertions(+)
fsck/main.c +0 -0
index 410e756..c2f57bc 100644

fsck/main.c static int erofs_verify_inode_data(struct erofs_inode *inode, int outfd) · line 461

Quoted 4 lines
fsck/main.c +1 -0
@@ -458,12 +458,16 @@ static int erofs_verify_inode_data(struct erofs_inode *inode, int outfd)
 				.in = raw,
 				.out = buffer,
 				.decodedskip = 0,
+				.interlaced_offset = 0,

Could we use

	.interlace_offset =
		map.m_algorithmformat == Z_EROFS_COMPRESSION_INTERLACED ?
			rq.interlaced_offset : 0,

here instead?

Thanks,
Gao Xiang

Quoted 14 lines
fsck/main.c +3 -0
 				.inputsize = map.m_plen,
 				.decodedlength = map.m_llen,
 				.alg = map.m_algorithmformat,
 				.partial_decoding = 0
 			};
 
+			if (map.m_algorithmformat == Z_EROFS_COMPRESSION_INTERLACED)
+				rq.interlaced_offset = erofs_blkoff(map.m_la);
+
 			ret = z_erofs_decompress(&rq);
 			if (ret < 0) {
 				erofs_err("failed to decompress data of m_pa %" PRIu64 ", m_plen %" PRIu64 " @ nid %llu: %s",
Signature · 1 line
2.17.1
author
#2 lore raw
Quoted 22 lines · On Wed, 21 Dec 2022 15:49:34 +0800 Gao Xiang <[email protected]>…
Quoted 15 lines · Yue Hu

From: Yue Hu <[email protected]>

Support uncompressed data layout with on-disk interlaced offset in compression mode for fsck.erofs.

---
 fsck/main.c | 4 ++++
 1 file changed, 4 insertions(+)
fsck/main.c +0 -0
index 410e756..c2f57bc 100644

fsck/main.c static int erofs_verify_inode_data(struct erofs_inode *inode, int outfd) · line 461

Quoted 4 lines
fsck/main.c +1 -0
@@ -458,12 +458,16 @@ static int erofs_verify_inode_data(struct erofs_inode *inode, int outfd)
 				.in = raw,
 				.out = buffer,
 				.decodedskip = 0,
+				.interlaced_offset = 0,  

Could we use

Quoted 5 lines
	.interlace_offset =
		map.m_algorithmformat == Z_EROFS_COMPRESSION_INTERLACED ?
			rq.interlaced_offset : 0,

here instead?

Okay, let me send v2 in this way.

Quoted 18 lines

Thanks,
Gao Xiang

Quoted 14 lines
fsck/main.c +3 -0
 				.inputsize = map.m_plen,
 				.decodedlength = map.m_llen,
 				.alg = map.m_algorithmformat,
 				.partial_decoding = 0
 			};
 
+			if (map.m_algorithmformat == Z_EROFS_COMPRESSION_INTERLACED)
+				rq.interlaced_offset = erofs_blkoff(map.m_la);
+
 			ret = z_erofs_decompress(&rq);
 			if (ret < 0) {
 				erofs_err("failed to decompress data of m_pa %" PRIu64 ", m_plen %" PRIu64 " @ nid %llu: %s",
Signature · 1 line
2.17.1