Skip to content

Commit

Permalink
Btrfs: apply updated fallocate i_size fix
Browse files Browse the repository at this point in the history
This version of the i_size fix for fallocate makes sure we only update
the i_size when the current fallocate is really operating outside of
i_size.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Aneesh Kumar K.V authored and Chris Mason committed Feb 4, 2010
1 parent efd049f commit 23b5c50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5799,7 +5799,9 @@ static int prealloc_file_range(struct inode *inode, u64 start, u64 end,
inode->i_ctime = CURRENT_TIME;
BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC;
if (!(mode & FALLOC_FL_KEEP_SIZE) &&
cur_offset > inode->i_size) {
(actual_len > inode->i_size) &&
(cur_offset > inode->i_size)) {

if (cur_offset > actual_len)
i_size = actual_len;
else
Expand Down

0 comments on commit 23b5c50

Please sign in to comment.