From a5b9a61e453b8602444a60ce7b531a053ee70cab Mon Sep 17 00:00:00 2001 From: Gao Xiang Date: Wed, 25 Dec 2024 15:04:54 +0800 Subject: [PATCH] erofs-utils: lib: fix btype for the data tails of directories It should be DIRA instead of DATA for directories. Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20241225070454.750271-1-hsiangkao@linux.alibaba.com --- lib/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/inode.c b/lib/inode.c index c4edd43..91ff4ce 100644 --- a/lib/inode.c +++ b/lib/inode.c @@ -850,7 +850,8 @@ static int erofs_write_tail_end(struct erofs_inode *inode) erofs_off_t pos, zero_pos; if (!bh) { - bh = erofs_balloc(sbi->bmgr, DATA, + bh = erofs_balloc(sbi->bmgr, + S_ISDIR(inode->i_mode) ? DIRA: DATA, erofs_blksiz(sbi), 0, 0); if (IS_ERR(bh)) return PTR_ERR(bh); -- 2.34.1