erofs-utils: lib: fix dirent type of whiteout in tarerofs
authorJingbo Xu <jefflexu@linux.alibaba.com>
Wed, 23 Aug 2023 07:15:08 +0000 (15:15 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 24 Aug 2023 17:53:49 +0000 (01:53 +0800)
Set the correct dirent type for whiteout.

Fixes: 95d315fd7958 ("erofs-utils: introduce tarerofs")
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230823071517.12303-2-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
lib/tar.c

index 42590d2d218a48f17ecd7e872333b395623a3882..328ab9843c9fc51f25646882e841e0d8d571975d 100644 (file)
--- a/lib/tar.c
+++ b/lib/tar.c
@@ -694,6 +694,7 @@ new_inode:
        if (whout) {
                inode->i_mode = (inode->i_mode & ~S_IFMT) | S_IFCHR;
                inode->u.i_rdev = EROFS_WHITEOUT_DEV;
+               d->type = EROFS_FT_CHRDEV;
        } else {
                inode->i_mode = st.st_mode;
                if (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode))