Commit da83fc6e authored by Linus Torvalds's avatar Linus Torvalds

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
parents 90d51d56 0bfaa9c5
...@@ -484,8 +484,19 @@ void btrfs_wait_logged_extents(struct btrfs_root *log, u64 transid) ...@@ -484,8 +484,19 @@ void btrfs_wait_logged_extents(struct btrfs_root *log, u64 transid)
log_list); log_list);
list_del_init(&ordered->log_list); list_del_init(&ordered->log_list);
spin_unlock_irq(&log->log_extents_lock[index]); spin_unlock_irq(&log->log_extents_lock[index]);
if (!test_bit(BTRFS_ORDERED_IO_DONE, &ordered->flags) &&
!test_bit(BTRFS_ORDERED_DIRECT, &ordered->flags)) {
struct inode *inode = ordered->inode;
u64 start = ordered->file_offset;
u64 end = ordered->file_offset + ordered->len - 1;
WARN_ON(!inode);
filemap_fdatawrite_range(inode->i_mapping, start, end);
}
wait_event(ordered->wait, test_bit(BTRFS_ORDERED_IO_DONE, wait_event(ordered->wait, test_bit(BTRFS_ORDERED_IO_DONE,
&ordered->flags)); &ordered->flags));
btrfs_put_ordered_extent(ordered); btrfs_put_ordered_extent(ordered);
spin_lock_irq(&log->log_extents_lock[index]); spin_lock_irq(&log->log_extents_lock[index]);
} }
......
...@@ -1680,11 +1680,11 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path) ...@@ -1680,11 +1680,11 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
if (device->bdev == root->fs_info->fs_devices->latest_bdev) if (device->bdev == root->fs_info->fs_devices->latest_bdev)
root->fs_info->fs_devices->latest_bdev = next_device->bdev; root->fs_info->fs_devices->latest_bdev = next_device->bdev;
if (device->bdev) if (device->bdev) {
device->fs_devices->open_devices--; device->fs_devices->open_devices--;
/* remove sysfs entry */
/* remove sysfs entry */ btrfs_kobj_rm_device(root->fs_info, device);
btrfs_kobj_rm_device(root->fs_info, device); }
call_rcu(&device->rcu, free_device); call_rcu(&device->rcu, free_device);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment