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: <b7e73c24-ccb2-4f06-90b7-bf697961003e@oracle.com>
Date:   Mon, 23 Jan 2017 12:43:19 -0600
From:   Dave Kleikamp <dave.kleikamp@...cle.com>
To:     Fabian Frederick <fabf@...net.be>,
        Dave Kleikamp <shaggy@...nel.org>
Cc:     jfs-discussion@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1 linux-next] jfs: atomically read inode size

On 01/23/2017 11:50 AM, Fabian Frederick wrote:
> See i_size_read() comments in include/linux/fs.h

Is this fixing a real problem? Can the bd_inode size change while we're
mounting or resizing the filesystem?

> 
> Signed-off-by: Fabian Frederick <fabf@...net.be>
> ---
>  fs/jfs/resize.c | 4 ++--
>  fs/jfs/super.c  | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c
> index bd9b641..7ddcb44 100644
> --- a/fs/jfs/resize.c
> +++ b/fs/jfs/resize.c
> @@ -98,7 +98,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
>  		goto out;
>  	}
>  
> -	VolumeSize = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits;
> +	VolumeSize = i_size_read(sb->s_bdev->bd_inode) >> sb->s_blocksize_bits;
>  
>  	if (VolumeSize) {
>  		if (newLVSize > VolumeSize) {
> @@ -211,7 +211,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
>  	txQuiesce(sb);
>  
>  	/* Reset size of direct inode */
> -	sbi->direct_inode->i_size =  sb->s_bdev->bd_inode->i_size;
> +	sbi->direct_inode->i_size =  i_size_read(sb->s_bdev->bd_inode);
>  
>  	if (sbi->mntflag & JFS_INLINELOG) {
>  		/*
> diff --git a/fs/jfs/super.c b/fs/jfs/super.c
> index c64c257..ad02f00 100644
> --- a/fs/jfs/super.c
> +++ b/fs/jfs/super.c
> @@ -283,7 +283,7 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
>  		}
>  		case Opt_resize_nosize:
>  		{
> -			*newLVSize = sb->s_bdev->bd_inode->i_size >>
> +			*newLVSize = i_size_read(sb->s_bdev->bd_inode) >>
>  				sb->s_blocksize_bits;
>  			if (*newLVSize == 0)
>  				pr_err("JFS: Cannot determine volume size\n");
> @@ -549,7 +549,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
>  		goto out_unload;
>  	}
>  	inode->i_ino = 0;
> -	inode->i_size = sb->s_bdev->bd_inode->i_size;
> +	inode->i_size = i_size_read(sb->s_bdev->bd_inode);
>  	inode->i_mapping->a_ops = &jfs_metapage_aops;
>  	hlist_add_fake(&inode->i_hash);
>  	mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ