It should be DIRA instead of DATA for directories.
Signed-off-by: Gao Xiang <[email protected]>
---
lib/inode.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/inode.c b/lib/inode.c
index de6d020..7ee5d78 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -870,7 +870,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);
if (IS_ERR(bh))
return PTR_ERR(bh);
--
2.43.5