diff options
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r-- | fs/xfs/xfs_inode.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index c10e3fadd9af..9af2882e1f4c 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -102,7 +102,7 @@ xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size) | |||
102 | { | 102 | { |
103 | xfs_fsize_t i_size = i_size_read(VFS_I(ip)); | 103 | xfs_fsize_t i_size = i_size_read(VFS_I(ip)); |
104 | 104 | ||
105 | if (new_size > i_size) | 105 | if (new_size > i_size || new_size < 0) |
106 | new_size = i_size; | 106 | new_size = i_size; |
107 | return new_size > ip->i_d.di_size ? new_size : 0; | 107 | return new_size > ip->i_d.di_size ? new_size : 0; |
108 | } | 108 | } |