diff options
author | Gao Xiang <hsiangkao@linux.alibaba.com> | 2023-09-10 00:32:32 +0800 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2023-09-11 11:22:05 +0800 |
commit | b1a0c95c888568384cabe32f599284f72e409e24 (patch) | |
tree | b067783a702fa4c2c5d9ba9686bde906f38714f1 | |
parent | 1d9a3368e2548970518eff6e5e83d37590d18fc1 (diff) | |
download | erofs-utils-b1a0c95c888568384cabe32f599284f72e409e24.tar.gz |
erofs-utils: lib: always fix up xattr_isize even w/o xattrs
Don't assume xattr_isize is 0 before since it's not true for the
upcoming rebuild mode.
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230909163240.42057-6-hsiangkao@linux.alibaba.com
-rw-r--r-- | lib/xattr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/xattr.c b/lib/xattr.c index 671ae05..d755760 100644 --- a/lib/xattr.c +++ b/lib/xattr.c @@ -564,8 +564,10 @@ int erofs_prepare_xattr_ibody(struct erofs_inode *inode) struct inode_xattr_node *node; struct list_head *ixattrs = &inode->i_xattrs; - if (list_empty(ixattrs)) + if (list_empty(ixattrs)) { + inode->xattr_isize = 0; return 0; + } /* get xattr ibody size */ ret = sizeof(struct erofs_xattr_ibody_header); |