diff options
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 70dc8ca73e25..9aa01ec2138d 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1334,7 +1334,6 @@ static ssize_t __btrfs_direct_write(struct kiocb *iocb, | |||
1334 | loff_t *ppos, size_t count, size_t ocount) | 1334 | loff_t *ppos, size_t count, size_t ocount) |
1335 | { | 1335 | { |
1336 | struct file *file = iocb->ki_filp; | 1336 | struct file *file = iocb->ki_filp; |
1337 | struct inode *inode = fdentry(file)->d_inode; | ||
1338 | struct iov_iter i; | 1337 | struct iov_iter i; |
1339 | ssize_t written; | 1338 | ssize_t written; |
1340 | ssize_t written_buffered; | 1339 | ssize_t written_buffered; |
@@ -1344,18 +1343,6 @@ static ssize_t __btrfs_direct_write(struct kiocb *iocb, | |||
1344 | written = generic_file_direct_write(iocb, iov, &nr_segs, pos, ppos, | 1343 | written = generic_file_direct_write(iocb, iov, &nr_segs, pos, ppos, |
1345 | count, ocount); | 1344 | count, ocount); |
1346 | 1345 | ||
1347 | /* | ||
1348 | * the generic O_DIRECT will update in-memory i_size after the | ||
1349 | * DIOs are done. But our endio handlers that update the on | ||
1350 | * disk i_size never update past the in memory i_size. So we | ||
1351 | * need one more update here to catch any additions to the | ||
1352 | * file | ||
1353 | */ | ||
1354 | if (inode->i_size != BTRFS_I(inode)->disk_i_size) { | ||
1355 | btrfs_ordered_update_i_size(inode, inode->i_size, NULL); | ||
1356 | mark_inode_dirty(inode); | ||
1357 | } | ||
1358 | |||
1359 | if (written < 0 || written == count) | 1346 | if (written < 0 || written == count) |
1360 | return written; | 1347 | return written; |
1361 | 1348 | ||