[PATCH] erofs-utils: mkfs: Use extended inodes when ctime is set

Gao Xiang hsiangkao at linux.alibaba.com
Tue Mar 1 16:17:39 AEDT 2022


Hi David,

On Tue, Mar 01, 2022 at 04:10:37AM +0000, David Anderson via Linux-erofs wrote:
> Currently ctime is effectively ignored because most inodes are compact.
> If ctime was set, and it's different from the build time, then extended
> inodes should be used instead.
> 
> To guarantee that timestamps do not cause extended inodes, a fixed
> timestamp should be used (-T).

Thanks for the patch.

How about introducing some option like '-E preserve-time' since
compact inodes are mainly used for reproducible builds, which I think
per-file timestamp is useless...

Also after I checked ociv2-brainstorm, they'd like to avoid timestamp as
well, which can be effective used by EROFS compact inodes...

https://hackmd.io/@cyphar/ociv2-brainstorm

Thanks,
Gao Xiang

> 
> Change-Id: I3d2e5c5ffe2bdcabea6791b5def5973b507aa316
> Signed-off-by: David Anderson <dvander at google.com>
> ---
>  lib/inode.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/inode.c b/lib/inode.c
> index f0a71a8..6f36c09 100644
> --- a/lib/inode.c
> +++ b/lib/inode.c
> @@ -730,6 +730,10 @@ static bool erofs_should_use_inode_extended(struct erofs_inode *inode)
>  		return true;
>  	if (inode->i_nlink > USHRT_MAX)
>  		return true;
> +	if (inode->i_ctime != sbi.build_time ||
> +	    inode->i_ctime_nsec != sbi.build_time_nsec) {
> +		return true;
> +	}
>  	return false;
>  }
>  
> -- 
> 2.35.1.574.g5d30c73bfb-goog


More information about the Linux-erofs mailing list