summaryrefslogtreecommitdiffstats
path: root/fs/udf/file.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-06-13 16:08:52 +0200
committerJan Kara <jack@suse.cz>2017-06-14 11:21:01 +0200
commit146c4ad6ec034a1fbfbf90ba76cb69b6504c374a (patch)
tree8de22d1bbc50561db8994465ca48b1610c1eee3c /fs/udf/file.c
parentudf: Fix races with i_size changes during readpage (diff)
downloadlinux-146c4ad6ec034a1fbfbf90ba76cb69b6504c374a.tar.xz
linux-146c4ad6ec034a1fbfbf90ba76cb69b6504c374a.zip
udf: Use i_size_read() in udf_adinicb_writepage()
We don't hold inode_lock in udf_adinicb_writepage() so use i_size_read() to get i_size. This cannot cause real problems is i_size is guaranteed to be small but let's be careful. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/file.c')
-rw-r--r--fs/udf/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c
index e06d2c15749a..356c2bf148a5 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -76,7 +76,8 @@ static int udf_adinicb_writepage(struct page *page,
BUG_ON(!PageLocked(page));
kaddr = kmap_atomic(page);
- memcpy(iinfo->i_ext.i_data + iinfo->i_lenEAttr, kaddr, inode->i_size);
+ memcpy(iinfo->i_ext.i_data + iinfo->i_lenEAttr, kaddr,
+ i_size_read(inode));
SetPageUptodate(page);
kunmap_atomic(kaddr);
mark_inode_dirty(inode);