erofs-utils: mkfs: fix crash when failing to build tree
authorGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 9 Jan 2025 05:05:14 +0000 (13:05 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 9 Jan 2025 07:43:25 +0000 (15:43 +0800)
commit3bd00bf7bd9aab03b1e7e0a36fe608719739ee09
tree4864af86553d983292033e9bd3a9a3fe18df06a4
parent06875b3f2182eab24b81083dfde542f778b201cc
erofs-utils: mkfs: fix crash when failing to build tree

For example: It crashes instead of cleanly erroring out if there's
a file for which it doesn't have permissions to read (e.g. /etc/gshadow
has mode 000).

Reported-by: Jonathan Lebon <jonathan@jlebon.com>
Fixes: 6a8e395ae4fd ("erofs-utils: fix up root inode for incremental builds")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250109050514.3836023-1-hsiangkao@linux.alibaba.com
mkfs/main.c