diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-20 23:21:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-20 23:21:05 -0400 |
commit | da83fc6e0f379bf80d68d34cca38788a046a71f4 (patch) | |
tree | 8ea6f2b69f8d899c2bb49f0445a93c4f232252ea | |
parent | 90d51d56069f8c63b043bacf55c62a98df88ef67 (diff) | |
parent | 0bfaa9c5cb479cebc24979b384374fe47500b4c9 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull btrfs fixes from Chris Mason:
"We have two more fixes in my for-linus branch.
I was hoping to also include a fix for a btrfs deadlock with
compression enabled, but we're still nailing that one down"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
btrfs: test for valid bdev before kobj removal in btrfs_rm_device
Btrfs: fix abnormal long waiting in fsync
-rw-r--r-- | fs/btrfs/ordered-data.c | 11 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 8 |
2 files changed, 15 insertions, 4 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 | } |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 6104676857f5..6cb82f62cb7c 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -1680,11 +1680,11 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path) | |||
1680 | if (device->bdev == root->fs_info->fs_devices->latest_bdev) | 1680 | if (device->bdev == root->fs_info->fs_devices->latest_bdev) |
1681 | root->fs_info->fs_devices->latest_bdev = next_device->bdev; | 1681 | root->fs_info->fs_devices->latest_bdev = next_device->bdev; |
1682 | 1682 | ||
1683 | if (device->bdev) | 1683 | if (device->bdev) { |
1684 | device->fs_devices->open_devices--; | 1684 | device->fs_devices->open_devices--; |
1685 | 1685 | /* remove sysfs entry */ | |
1686 | /* remove sysfs entry */ | 1686 | btrfs_kobj_rm_device(root->fs_info, device); |
1687 | btrfs_kobj_rm_device(root->fs_info, device); | 1687 | } |
1688 | 1688 | ||
1689 | call_rcu(&device->rcu, free_device); | 1689 | call_rcu(&device->rcu, free_device); |
1690 | 1690 | ||