Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull btrfs fixes from Chris Mason: "These are scattered fixes and one performance improvement. The biggest functional change is in how we throttle metadata changes. The new code bumps our average file creation rate up by ~13% in fs_mark, and lowers CPU usage. Stefan bisected out a regression in our allocation code that made balance loop on extents larger than 256MB." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: Btrfs: improve the delayed inode throttling Btrfs: fix a mismerge in btrfs_balance() Btrfs: enforce min_bytes parameter during extent allocation Btrfs: allow running defrag in parallel to administrative tasks Btrfs: avoid deadlock on transaction waiting list Btrfs: do not BUG_ON on aborted situation Btrfs: do not BUG_ON in prepare_to_reloc Btrfs: free all recorded tree blocks on error Btrfs: build up error handling for merge_reloc_roots Btrfs: check for NULL pointer in updating reloc roots Btrfs: fix unclosed transaction handler when the async transaction commitment fails Btrfs: fix wrong handle at error path of create_snapshot() when the commit fails Btrfs: use set_nlink if our i_nlink is 0
This commit is contained in:
@@ -527,6 +527,8 @@ fail:
|
||||
if (async_transid) {
|
||||
*async_transid = trans->transid;
|
||||
err = btrfs_commit_transaction_async(trans, root, 1);
|
||||
if (err)
|
||||
err = btrfs_commit_transaction(trans, root);
|
||||
} else {
|
||||
err = btrfs_commit_transaction(trans, root);
|
||||
}
|
||||
@@ -592,16 +594,14 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
|
||||
*async_transid = trans->transid;
|
||||
ret = btrfs_commit_transaction_async(trans,
|
||||
root->fs_info->extent_root, 1);
|
||||
if (ret)
|
||||
ret = btrfs_commit_transaction(trans, root);
|
||||
} else {
|
||||
ret = btrfs_commit_transaction(trans,
|
||||
root->fs_info->extent_root);
|
||||
}
|
||||
if (ret) {
|
||||
/* cleanup_transaction has freed this for us */
|
||||
if (trans->aborted)
|
||||
pending_snapshot = NULL;
|
||||
if (ret)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = pending_snapshot->error;
|
||||
if (ret)
|
||||
@@ -2245,13 +2245,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
|
||||
1)) {
|
||||
pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n");
|
||||
mnt_drop_write_file(file);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (btrfs_root_readonly(root)) {
|
||||
ret = -EROFS;
|
||||
goto out;
|
||||
@@ -2306,7 +2299,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
|
||||
ret = -EINVAL;
|
||||
}
|
||||
out:
|
||||
atomic_set(&root->fs_info->mutually_exclusive_operation_running, 0);
|
||||
mnt_drop_write_file(file);
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user