Commit bed3c0d8 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-5.2-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:

 - regression where properties stored as xattrs are not properly
   persisted

 - a small readahead fix (the fstests testcase for that fix hangs on
   unpatched kernel, so we'd like get it merged to ease future testing)

 - fix a race during block group creation and deletion

* tag 'for-5.2-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  Btrfs: fix failure to persist compression property xattr deletion on fsync
  btrfs: start readahead also in seed devices
  Btrfs: fix race between block group removal and block group allocation
parents 7b306892 3763771c
...@@ -10831,17 +10831,6 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, ...@@ -10831,17 +10831,6 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
remove_em = (atomic_read(&block_group->trimming) == 0); remove_em = (atomic_read(&block_group->trimming) == 0);
spin_unlock(&block_group->lock); spin_unlock(&block_group->lock);
if (remove_em) {
struct extent_map_tree *em_tree;
em_tree = &fs_info->mapping_tree.map_tree;
write_lock(&em_tree->lock);
remove_extent_mapping(em_tree, em);
write_unlock(&em_tree->lock);
/* once for the tree */
free_extent_map(em);
}
mutex_unlock(&fs_info->chunk_mutex); mutex_unlock(&fs_info->chunk_mutex);
ret = remove_block_group_free_space(trans, block_group); ret = remove_block_group_free_space(trans, block_group);
...@@ -10858,6 +10847,19 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, ...@@ -10858,6 +10847,19 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
goto out; goto out;
ret = btrfs_del_item(trans, root, path); ret = btrfs_del_item(trans, root, path);
if (ret)
goto out;
if (remove_em) {
struct extent_map_tree *em_tree;
em_tree = &fs_info->mapping_tree.map_tree;
write_lock(&em_tree->lock);
remove_extent_mapping(em_tree, em);
write_unlock(&em_tree->lock);
/* once for the tree */
free_extent_map(em);
}
out: out:
if (remove_rsv) if (remove_rsv)
btrfs_delayed_refs_rsv_release(fs_info, 1); btrfs_delayed_refs_rsv_release(fs_info, 1);
......
...@@ -312,8 +312,6 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) ...@@ -312,8 +312,6 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
goto out_end_trans; goto out_end_trans;
} }
set_bit(BTRFS_INODE_COPY_EVERYTHING,
&BTRFS_I(inode)->runtime_flags);
} else { } else {
ret = btrfs_set_prop(trans, inode, "btrfs.compression", NULL, ret = btrfs_set_prop(trans, inode, "btrfs.compression", NULL,
0, 0); 0, 0);
......
...@@ -747,6 +747,7 @@ static void __reada_start_machine(struct btrfs_fs_info *fs_info) ...@@ -747,6 +747,7 @@ static void __reada_start_machine(struct btrfs_fs_info *fs_info)
u64 total = 0; u64 total = 0;
int i; int i;
again:
do { do {
enqueued = 0; enqueued = 0;
mutex_lock(&fs_devices->device_list_mutex); mutex_lock(&fs_devices->device_list_mutex);
...@@ -758,6 +759,10 @@ static void __reada_start_machine(struct btrfs_fs_info *fs_info) ...@@ -758,6 +759,10 @@ static void __reada_start_machine(struct btrfs_fs_info *fs_info)
mutex_unlock(&fs_devices->device_list_mutex); mutex_unlock(&fs_devices->device_list_mutex);
total += enqueued; total += enqueued;
} while (enqueued && total < 10000); } while (enqueued && total < 10000);
if (fs_devices->seed) {
fs_devices = fs_devices->seed;
goto again;
}
if (enqueued == 0) if (enqueued == 0)
return; return;
......
...@@ -213,6 +213,9 @@ int btrfs_setxattr(struct btrfs_trans_handle *trans, struct inode *inode, ...@@ -213,6 +213,9 @@ int btrfs_setxattr(struct btrfs_trans_handle *trans, struct inode *inode,
} }
out: out:
btrfs_free_path(path); btrfs_free_path(path);
if (!ret)
set_bit(BTRFS_INODE_COPY_EVERYTHING,
&BTRFS_I(inode)->runtime_flags);
return ret; return ret;
} }
...@@ -236,7 +239,6 @@ int btrfs_setxattr_trans(struct inode *inode, const char *name, ...@@ -236,7 +239,6 @@ int btrfs_setxattr_trans(struct inode *inode, const char *name,
inode_inc_iversion(inode); inode_inc_iversion(inode);
inode->i_ctime = current_time(inode); inode->i_ctime = current_time(inode);
set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags);
ret = btrfs_update_inode(trans, root, inode); ret = btrfs_update_inode(trans, root, inode);
BUG_ON(ret); BUG_ON(ret);
out: out:
...@@ -388,8 +390,6 @@ static int btrfs_xattr_handler_set_prop(const struct xattr_handler *handler, ...@@ -388,8 +390,6 @@ static int btrfs_xattr_handler_set_prop(const struct xattr_handler *handler,
if (!ret) { if (!ret) {
inode_inc_iversion(inode); inode_inc_iversion(inode);
inode->i_ctime = current_time(inode); inode->i_ctime = current_time(inode);
set_bit(BTRFS_INODE_COPY_EVERYTHING,
&BTRFS_I(inode)->runtime_flags);
ret = btrfs_update_inode(trans, root, inode); ret = btrfs_update_inode(trans, root, inode);
BUG_ON(ret); BUG_ON(ret);
} }
......
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