summaryrefslogtreecommitdiffstats
path: root/fs/udf/super.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2017-01-06 21:54:41 +0100
committerJan Kara <jack@suse.cz>2017-01-10 11:57:34 +0100
commit23bcda112f77da278898841615c7530c3e91a537 (patch)
treeeab6c30d9acceffe706831f43d5a10f20abeb02b /fs/udf/super.c
parent54bb60d53114b83473ba1c622be4cca9533b9827 (diff)
downloadlinux-23bcda112f77da278898841615c7530c3e91a537.tar.gz
linux-23bcda112f77da278898841615c7530c3e91a537.tar.bz2
linux-23bcda112f77da278898841615c7530c3e91a537.zip
udf: 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: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r--fs/udf/super.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 9256117ffa27..6b5a1a45a6c1 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1213,7 +1213,8 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
struct udf_inode_info *vati;
uint32_t pos;
struct virtualAllocationTable20 *vat20;
- sector_t blocks = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits;
+ sector_t blocks = i_size_read(sb->s_bdev->bd_inode) >>
+ sb->s_blocksize_bits;
udf_find_vat_block(sb, p_index, type1_index, sbi->s_last_block);
if (!sbi->s_vat_inode &&
@@ -1803,7 +1804,7 @@ static int udf_check_anchor_block(struct super_block *sb, sector_t block,
if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV) &&
udf_fixed_to_variable(block) >=
- sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits)
+ i_size_read(sb->s_bdev->bd_inode) >> sb->s_blocksize_bits)
return -EAGAIN;
bh = udf_read_tagged(sb, block, block, &ident);
@@ -1865,7 +1866,7 @@ static int udf_scan_anchors(struct super_block *sb, sector_t *lastblock,
last[last_count++] = *lastblock - 152;
for (i = 0; i < last_count; i++) {
- if (last[i] >= sb->s_bdev->bd_inode->i_size >>
+ if (last[i] >= i_size_read(sb->s_bdev->bd_inode) >>
sb->s_blocksize_bits)
continue;
ret = udf_check_anchor_block(sb, last[i], fileset);