Skip to contentSkip to conversation

erofs-utils: lib: fix btype for the data tails of directories

PATCH New Gao Xiang 1 participant 1 message Dec 25, 2024 Library code

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs-utils: lib: fix btype for the data tails of directories

It should be DIRA instead of DATA for directories.

---
 lib/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/inode.c +2 -1
index de6d020..7ee5d78 100644
@@ -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);
Signature · 1 line
2.43.5