Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Jingbo Xu <jefflexu@linux.alibaba.com>,
	chao@kernel.org, huyue2@coolpad.com,
	linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH 2/2] erofs-utils: introduce tarerofs
Date: Thu, 13 Jul 2023 15:18:52 +0800	[thread overview]
Message-ID: <2c0b941b-e679-d773-34b6-fd55d765dd00@linux.alibaba.com> (raw)
In-Reply-To: <20230711061240.23662-2-jefflexu@linux.alibaba.com>



On 2023/7/11 14:12, Jingbo Xu wrote:
> From: Gao Xiang <hsiangkao@linux.alibaba.com>
> 
> Let's try to add a new mode "tarerofs" for mkfs.erofs.
> 
> It mainly aims at two use cases:
>   - Convert a tarball (or later tarballs with a merged view) into
>     a full EROFS image [--tar=f];
> 
>   - Generate an EROFS manifest image to reuse tar data [--tar=i],
>     which also enables EROFS 512-byte blocks.
> 
> The second use case is mainly prepared for OCI direct mount without
> OCI blob unpacking.  This also adds another `--aufs` option to
> transform aufs special files into overlayfs metadata.
> 
> [ Note that `--tar=f` generates lots of temporary files for now which
>    can impact performance since the original tar stream(s) may be
>    non-seekable. ]
> 
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
> Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
> ---
> change log:
> 1. don't return prematurely for special device files (in
> erofs_mkfs_build_tree()).  Otherwise erofs_mkfs_build_tree() may
> mistakenly return a positive integer number returned from
> erofs_prepare_xattr_ibody(), and mistakenly make it as the pointer to
> the root inode, which will cause mkfs.erofs segmentation fault.
> 2. automatically create parent directory if it's not included as an
> entry in the tarball stream. (refer to tarerofs_init_default_dir())


struct erofs_dentry *tarerofs_mkdir(struct erofs_inode *dir, const char *s)
{
	struct inode *inode;

	inode = erofs_new_inode();
	if (IS_ERR(inode))
		return inode;

	inode->i_mode = S_IFDIR | 0755;
	inode->i_parent = dir;
	inode->i_uid = getuid();
	inode->i_gid = getgid();
	inode->i_mtime = sbi.build_time;
	inode->i_mtime_nsec = sbi.build_time_nsec;
	tarerofs_init_empty_dir(inode);

	d = erofs_d_alloc(pwd, s);
	d->type = EROFS_FT_DIR;
	d->inode = inode;
	return d;

}
?


Otherwise it looks good to me.

Thanks,
Gao Xiang

      reply	other threads:[~2023-07-13  7:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11  6:12 [PATCH 1/2] erofs-utils: add ERR_CAST macro Jingbo Xu
2023-07-11  6:12 ` [PATCH 2/2] erofs-utils: introduce tarerofs Jingbo Xu
2023-07-13  7:18   ` Gao Xiang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c0b941b-e679-d773-34b6-fd55d765dd00@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=chao@kernel.org \
    --cc=huyue2@coolpad.com \
    --cc=jefflexu@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox