* [PATCH 1/2] erofs-utils: lib: get rid of unused erofs_ftype_to_dtype()
@ 2026-10-07 20:49 Gao Xiang
2026-10-07 20:49 ` [PATCH 2/2] erofs-utils: tar: Fix printing uninitialized memory from xattr value Gao Xiang
0 siblings, 1 reply; 2+ messages in thread
From: Gao Xiang @ 2026-10-07 20:49 UTC (permalink / raw)
To: linux-erofs; +Cc: Gao Xiang
It has been unused since commit 9fd2a2250fa9 ("erofs-utils: fuse: switch
to FUSE 2/3 lowlevel APIs").
Signed-off-by: Gao Xiang <xiang@kernel.org>
---
include/erofs/inode.h | 1 -
lib/inode.c | 19 -------------------
2 files changed, 20 deletions(-)
diff --git a/include/erofs/inode.h b/include/erofs/inode.h
index 23848e8..5b67b95 100644
--- a/include/erofs/inode.h
+++ b/include/erofs/inode.h
@@ -28,7 +28,6 @@ struct erofs_importer;
u32 erofs_new_encode_dev(dev_t dev);
unsigned char erofs_mode_to_ftype(umode_t mode);
umode_t erofs_ftype_to_mode(unsigned int ftype, unsigned int perm);
-unsigned char erofs_ftype_to_dtype(unsigned int filetype);
void erofs_inode_manager_init(void);
void erofs_insert_ihash(struct erofs_inode *inode);
void erofs_remove_ihash(struct erofs_inode *inode);
diff --git a/lib/inode.c b/lib/inode.c
index d819659..da29b5a 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -54,17 +54,6 @@ unsigned char erofs_mode_to_ftype(umode_t mode)
return erofs_ftype_by_mode[(mode & S_IFMT) >> S_SHIFT];
}
-static const unsigned char erofs_dtype_by_ftype[EROFS_FT_MAX] = {
- [EROFS_FT_UNKNOWN] = DT_UNKNOWN,
- [EROFS_FT_REG_FILE] = DT_REG,
- [EROFS_FT_DIR] = DT_DIR,
- [EROFS_FT_CHRDEV] = DT_CHR,
- [EROFS_FT_BLKDEV] = DT_BLK,
- [EROFS_FT_FIFO] = DT_FIFO,
- [EROFS_FT_SOCK] = DT_SOCK,
- [EROFS_FT_SYMLINK] = DT_LNK
-};
-
static const umode_t erofs_dtype_by_umode[EROFS_FT_MAX] = {
[EROFS_FT_UNKNOWN] = S_IFMT,
[EROFS_FT_REG_FILE] = S_IFREG,
@@ -84,14 +73,6 @@ umode_t erofs_ftype_to_mode(unsigned int ftype, unsigned int perm)
return erofs_dtype_by_umode[ftype] | perm;
}
-unsigned char erofs_ftype_to_dtype(unsigned int filetype)
-{
- if (filetype >= EROFS_FT_MAX)
- return DT_UNKNOWN;
-
- return erofs_dtype_by_ftype[filetype];
-}
-
static struct list_head erofs_ihash[65536];
static erofs_rwsem_t erofs_ihashlock;
--
2.50.1 (Apple Git-155)
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH 2/2] erofs-utils: tar: Fix printing uninitialized memory from xattr value
2026-10-07 20:49 [PATCH 1/2] erofs-utils: lib: get rid of unused erofs_ftype_to_dtype() Gao Xiang
@ 2026-10-07 20:49 ` Gao Xiang
0 siblings, 0 replies; 2+ messages in thread
From: Gao Xiang @ 2026-10-07 20:49 UTC (permalink / raw)
To: linux-erofs; +Cc: Andrew Gunnerson, Gao Xiang
From: Andrew Gunnerson <accounts+github@chiller3.com>
Link: https://github.com/chenxiaolong/erofs-utils/commit/093e9db89dd78c9cbf77aac26370d385c6a55ecd
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
Signed-off-by: Gao Xiang <xiang@kernel.org>
---
lib/tar.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/tar.c b/lib/tar.c
index f24ad95..560036e 100644
--- a/lib/tar.c
+++ b/lib/tar.c
@@ -416,12 +416,12 @@ int tarerofs_apply_xattrs(struct erofs_inode *inode, struct list_head *xattrs)
continue;
}
item->kv[item->namelen] = '\0';
- erofs_dbg("Recording xattr(%s)=\"%s\" (of %u bytes) to file %s",
- item->kv, v, vsz, inode->i_srcpath);
+ erofs_dbg("Recording xattr(%s)=\"%.*s\" (of %u bytes) to file %s",
+ item->kv, vsz, v, vsz, inode->i_srcpath);
ret = erofs_vfs_setxattr(inode, item->kv, v, vsz);
if (ret == -ENODATA)
- erofs_err("Failed to set xattr(%s)=%s to file %s",
- item->kv, v, inode->i_srcpath);
+ erofs_err("Failed to set xattr(%s)=%.*s to file %s",
+ item->kv, vsz, v, inode->i_srcpath);
else if (ret)
return ret;
}
--
2.50.1 (Apple Git-155)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-07 20:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-07 20:49 [PATCH 1/2] erofs-utils: lib: get rid of unused erofs_ftype_to_dtype() Gao Xiang
2026-10-07 20:49 ` [PATCH 2/2] erofs-utils: tar: Fix printing uninitialized memory from xattr value Gao Xiang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.