On 2026/1/14 15:44, Gao Xiang wrote:
we could support !im, I mean
struct erofs_importer_params *params = im ? im->params : NULL;
Hi Xiang,
Do we have any chance `im == NULL` in current codebase? Or is it to
allow for future extensibility?
struct erofs_inode *root;
@@ -2384,6 +2385,8 @@ struct erofs_inode
*erofs_rebuild_make_root(struct erofs_sb_info *sbi)
return root;
root->i_srcpath = strdup("/");
root->i_mode = S_IFDIR | 0777;
+ root->i_uid = im->params->fixed_uid == -1 ? getuid() :
im->params->fixed_uid;
+ root->i_gid = im->params->fixed_gid == -1 ? getgid() :
im->params->fixed_gid;
root->i_uid = params && params->fixed_uid < 0 ? getuid() :
params->fixed_uid;
will sigfault if `params == NULL`, how about
root->i_uid = (!params || params->fixed_uid < 0) ? getuid() :
params->fixed_uid;
Thanks,
Yifan
...