[FOR INTERNAL REVIEW] [PATCH 2/4] staging: erofs: fix superblock/inode flags (MS_RDONLY -> SB_RDONLY, S_NOATIME)

Chao Yu yuchao0 at huawei.com
Tue Jul 31 17:12:33 AEST 2018


Hi David,

staging/erofs was merged by Greg the other day, later, it went into
staging-next, yesterday, Stephen Rothwell reported us an compile failure in
linux-next tree, the reason is there were some common vfs stuff changes
including 0a43a939c77e ("vfs: Suppress MS_* flag defs within the kernel unless
explicitly enabled"), but erofs do not adjust those changes. We'd like to fix
the integration compiling error, Xiang Gao has made a patch for MS_* related
change, could you please help to review this patch?

On 2018/7/30 17:18, Gao Xiang wrote:
> After commit 0a43a939c77e ("vfs: Suppress MS_* flag defs within
> the kernel unless explicitly enabled"), there is no MS_RDONLY
> and MS_NOATIME at all.
> 
> Reported-by: Stephen Rothwell <sfr at canb.auug.org.au>
> Signed-off-by: Gao Xiang <gaoxiang25 at huawei.com>
> ---
> 
> - Tested with images generated by mkfs.erofs:
>    1) mount and unmount operations
>    2) md5sum `find . -type f`
>  
>  drivers/staging/erofs/inode.c | 6 ++++++
>  drivers/staging/erofs/super.c | 4 ++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c
> index fbf6ff2..809cbd0 100644
> --- a/drivers/staging/erofs/inode.c
> +++ b/drivers/staging/erofs/inode.c
> @@ -242,6 +242,12 @@ struct inode *erofs_iget(struct super_block *sb,
>  	if (inode->i_state & I_NEW) {
>  		int err;
>  		struct erofs_vnode *vi = EROFS_V(inode);
> +
> +		/*
> +		 * no need to use 'inode_set_flags'
> +		 * (see fuse_iget in fs/fuse/inode.c)
> +		 */
> +		inode->i_flags |= S_NOATIME;
>  		vi->nid = nid;
>  
>  		err = fill_inode(inode, isdir);
> diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c
> index 1aec509..ae1eb20 100644
> --- a/drivers/staging/erofs/super.c
> +++ b/drivers/staging/erofs/super.c
> @@ -340,7 +340,7 @@ static int erofs_read_super(struct super_block *sb,
>  		goto err_sbread;
>  
>  	sb->s_magic = EROFS_SUPER_MAGIC;
> -	sb->s_flags |= MS_RDONLY | MS_NOATIME;
> +	sb->s_flags |= SB_RDONLY;
>  	sb->s_maxbytes = MAX_LFS_FILESIZE;
>  	sb->s_time_gran = 1;
>  
> @@ -627,7 +627,7 @@ static int erofs_remount(struct super_block *sb, int *flags, char *data)
>  {
>  	BUG_ON(!sb_rdonly(sb));
>  
> -	*flags |= MS_RDONLY;
> +	*flags |= SB_RDONLY;
>  	return 0;
>  }
>  
> 



More information about the Linux-erofs mailing list