diff options
Diffstat (limited to 'fs/btrfs/ordered-data.c')
-rw-r--r-- | fs/btrfs/ordered-data.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index e12441c7cf1d..7187b14faa6c 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c | |||
@@ -484,8 +484,19 @@ void btrfs_wait_logged_extents(struct btrfs_root *log, u64 transid) | |||
484 | log_list); | 484 | log_list); |
485 | list_del_init(&ordered->log_list); | 485 | list_del_init(&ordered->log_list); |
486 | spin_unlock_irq(&log->log_extents_lock[index]); | 486 | spin_unlock_irq(&log->log_extents_lock[index]); |
487 | |||
488 | if (!test_bit(BTRFS_ORDERED_IO_DONE, &ordered->flags) && | ||
489 | !test_bit(BTRFS_ORDERED_DIRECT, &ordered->flags)) { | ||
490 | struct inode *inode = ordered->inode; | ||
491 | u64 start = ordered->file_offset; | ||
492 | u64 end = ordered->file_offset + ordered->len - 1; | ||
493 | |||
494 | WARN_ON(!inode); | ||
495 | filemap_fdatawrite_range(inode->i_mapping, start, end); | ||
496 | } | ||
487 | wait_event(ordered->wait, test_bit(BTRFS_ORDERED_IO_DONE, | 497 | wait_event(ordered->wait, test_bit(BTRFS_ORDERED_IO_DONE, |
488 | &ordered->flags)); | 498 | &ordered->flags)); |
499 | |||
489 | btrfs_put_ordered_extent(ordered); | 500 | btrfs_put_ordered_extent(ordered); |
490 | spin_lock_irq(&log->log_extents_lock[index]); | 501 | spin_lock_irq(&log->log_extents_lock[index]); |
491 | } | 502 | } |