projects
/
platform
/
upstream
/
erofs-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
088b5f9
)
erofs-utils: bail out properly if erofs_iget_from_path(root) fails
author
Gao Xiang
<hsiangkao@linux.alibaba.com>
Fri, 1 Sep 2023 15:59:32 +0000
(23:59 +0800)
committer
Gao Xiang
<hsiangkao@linux.alibaba.com>
Fri, 1 Sep 2023 17:58:02 +0000
(
01:58
+0800)
Or "Segmentation fault" can happen if errors are passed into
erofs_igrab().
Fixes: 21d84349e79a ("erofs-utils: rearrange on-disk metadata")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link:
https://lore.kernel.org/r/20230901155932.105830-1-hsiangkao@linux.alibaba.com
lib/inode.c
patch
|
blob
|
history
diff --git
a/lib/inode.c
b/lib/inode.c
index 85eacabd8349af79a0809e430e289f177624031d..a3a643fad8f057f036dee058b35493229db34bcc 100644
(file)
--- a/
lib/inode.c
+++ b/
lib/inode.c
@@
-1228,10
+1228,11
@@
struct erofs_inode *erofs_mkfs_build_tree_from_path(const char *path)
LIST_HEAD(dirs);
struct erofs_inode *inode, *root, *parent;
- root = erofs_ig
rab(erofs_iget_from_path(path, true)
);
+ root = erofs_ig
et_from_path(path, true
);
if (IS_ERR(root))
return root;
+ (void)erofs_igrab(root);
root->i_parent = root; /* rootdir mark */
root->subdirs_queued = 1;
list_add(&root->i_subdirs, &dirs);