Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: linux-erofs@lists.ozlabs.org, hsiangkao@linux.alibaba.com
Subject: [PATCH] tmp debug
Date: Tue,  4 Apr 2023 16:02:24 +0800	[thread overview]
Message-ID: <20230404080224.77577-8-jefflexu@linux.alibaba.com> (raw)
In-Reply-To: <20230404080224.77577-1-jefflexu@linux.alibaba.com>

Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
---
 lib/inode.c | 7 ++++++-
 lib/xattr.c | 3 +++
 mkfs/main.c | 4 ++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/inode.c b/lib/inode.c
index 6861b99..b252904 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -272,8 +272,11 @@ erofs_nid_t erofs_lookupnid(struct erofs_inode *inode)
 	struct erofs_buffer_head *const bh = inode->bh;
 	erofs_off_t off, meta_offset;
 
-	if (!bh || (long long)inode->nid > 0)
+	if (!bh || (long long)inode->nid > 0) {
+		erofs_dbg(" nid %llu to file %s, bh %p",
+		  inode->nid, inode->i_srcpath, inode->bh);
 		return inode->nid;
+	}
 
 	erofs_mapbh(bh->block);
 	off = erofs_btell(bh, false);
@@ -1266,6 +1269,8 @@ struct erofs_inode *erofs_mkfs_build_special_from_fd(int fd, const char *name)
 	if (name == EROFS_PACKED_INODE) {
 		sbi.packed_nid = EROFS_PACKED_NID_UNALLOCATED;
 		inode->nid = sbi.packed_nid;
+		erofs_dbg("erofs_mkfs_build_special_from_fd: nid %llu to file %s, bh %p",
+		  inode->nid, inode->i_srcpath, inode->bh);
 	}
 
 	ret = erofs_write_compressed_file(inode, fd);
diff --git a/lib/xattr.c b/lib/xattr.c
index de462ab..c336d9d 100644
--- a/lib/xattr.c
+++ b/lib/xattr.c
@@ -141,11 +141,14 @@ static bool match_prefix(const char *key, u8 *index, u16 *len)
 	struct xattr_prefix *p;
 	struct extra_xattr_type_node *tnode;
 
+	printf("[match_prefix]: enter extra_xattr_types_count++ is %u\n", extra_xattr_types_count);
 	list_for_each_entry(tnode, &extra_xattr_types, list) {
 		p = &tnode->type;
+		printf("[iterating]: key %s, prefix %s\n", key, p->prefix);
 		if (p->prefix && !strncmp(p->prefix, key, p->prefix_len)) {
 			*len = p->prefix_len;
 			*index = tnode->index;
+			printf("match_prefix: key %s, matches prefix %s, index %u\n", key, p->prefix, tnode->index);
 			return true;
 		}
 	}
diff --git a/mkfs/main.c b/mkfs/main.c
index d06f6f5..ce220c7 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -911,13 +911,17 @@ int main(int argc, char **argv)
 			erofs_update_progressinfo("Handling packed_file ...");
 			packed_inode = erofs_mkfs_build_packedfile();
 			if (IS_ERR(packed_inode)) {
+				printf("[%s %d] erofs_mkfs_build_packedfile failed\n", __func__, __LINE__);
 				err = PTR_ERR(packed_inode);
 				goto exit;
 			}
+			printf("[%s %d] start erofs_lookupnid...\n", __func__, __LINE__);
 			packed_nid = erofs_lookupnid(packed_inode);
+			printf("[%s %d] packed_nid %lu\n", __func__, __LINE__, packed_nid);
 			erofs_iput(packed_inode);
 		}
 	}
+	printf("[%s %d] packed_nid %lu\n", __func__, __LINE__, packed_nid);
 
 	err = erofs_mkfs_update_super_block(sb_bh, root_nid, &nblocks,
 					    packed_nid);
-- 
2.19.1.6.gb485710b


      parent reply	other threads:[~2023-04-04  8:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04  8:02 [PATCH 0/6] erofs-utils: introduce extra xattr name prefix Jingbo Xu
2023-04-04  8:02 ` [PATCH 1/6] erofs-utils: declare prefix_len as u8 Jingbo Xu
2023-04-04  8:02 ` [PATCH 2/6] erofs-utils: extract packedfile API Jingbo Xu
2023-04-04  8:02 ` [PATCH 3/6] erofs-utils: introduce on-disk format for extra xattr name prefix Jingbo Xu
2023-04-04  8:19   ` Gao Xiang
2023-04-04  8:02 ` [PATCH 4/6] erofs-utils: introduce init/cleanup routine " Jingbo Xu
2023-04-04  8:02 ` [PATCH 5/6] erofs-utils: build erofs_xattr_entry upon " Jingbo Xu
2023-04-04  8:02 ` [PATCH 6/6] erofs-utils: mkfs.erofs: introduce --xattr-prefix option Jingbo Xu
2023-04-04  8:02 ` Jingbo Xu [this message]

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=20230404080224.77577-8-jefflexu@linux.alibaba.com \
    --to=jefflexu@linux.alibaba.com \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.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