lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211126092108.GF13004@quack2.suse.cz>
Date:   Fri, 26 Nov 2021 10:21:08 +0100
From:   Jan Kara <jack@...e.cz>
To:     Chengguang Xu <cgxu519@...ernel.net>
Cc:     miklos@...redi.hu, jack@...e.cz, amir73il@...il.com,
        linux-unionfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Chengguang Xu <charliecgxu@...cent.com>
Subject: Re: [RFC PATCH V6 6/7] ovl: introduce ovl_sync_upper_blockdev()

On Mon 22-11-21 11:00:37, Chengguang Xu wrote:
> From: Chengguang Xu <charliecgxu@...cent.com>
> 
> Introduce new helper ovl_sync_upper_blockdev() to sync
> upper blockdev.
> 
> Signed-off-by: Chengguang Xu <charliecgxu@...cent.com>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/overlayfs/super.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> index 12acf0ec7395..ccffcd96491d 100644
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
> @@ -258,6 +258,16 @@ static void ovl_put_super(struct super_block *sb)
>  	ovl_free_fs(ofs);
>  }
>  
> +static int ovl_sync_upper_blockdev(struct super_block *sb, int wait)
> +{
> +	if (!sb->s_bdev)
> +		return 0;
> +
> +	if (!wait)
> +		return filemap_flush(sb->s_bdev->bd_inode->i_mapping);
> +	return filemap_write_and_wait_range(sb->s_bdev->bd_inode->i_mapping, 0, LLONG_MAX);
> +}
> +
>  /* Sync real dirty inodes in upper filesystem (if it exists) */
>  static int ovl_sync_fs(struct super_block *sb, int wait)
>  {
> -- 
> 2.27.0
> 
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ