Skip to content

Commit

Permalink
udf: Use i_size_read() in udf_adinicb_writepage()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Kara committed Jun 14, 2017
1 parent 9795e0e commit 146c4ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/udf/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 146c4ad

Please sign in to comment.