jfs: atomically read inode size

See i_size_read() comments in include/linux/fs.h

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
This commit is contained in:
Fabian Frederick 2017-01-23 18:50:23 +01:00 committed by Dave Kleikamp
parent d966564fcd
commit 684666e515
2 changed files with 4 additions and 4 deletions

View File

@ -98,7 +98,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
goto out; 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 (VolumeSize) {
if (newLVSize > VolumeSize) { if (newLVSize > VolumeSize) {
@ -211,7 +211,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
txQuiesce(sb); txQuiesce(sb);
/* Reset size of direct inode */ /* 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) { if (sbi->mntflag & JFS_INLINELOG) {
/* /*

View File

@ -283,7 +283,7 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
} }
case Opt_resize_nosize: 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; sb->s_blocksize_bits;
if (*newLVSize == 0) if (*newLVSize == 0)
pr_err("JFS: Cannot determine volume size\n"); 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; goto out_unload;
} }
inode->i_ino = 0; 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; inode->i_mapping->a_ops = &jfs_metapage_aops;
hlist_add_fake(&inode->i_hash); hlist_add_fake(&inode->i_hash);
mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);