3.16.60-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Nikolay Borisov <nbori...@suse.com>

commit efd38150af45375b46576d0110a323d7fab7e142 upstream.

If btrfs_transaction_commit fails it will proceed to call
cleanup_transaction, which in turn already does btrfs_abort_transaction.
So let's remove the unnecessary code duplication. Also let's be explicit
about handling failure of btrfs_uuid_tree_add by calling
btrfs_end_transaction.

Signed-off-by: Nikolay Borisov <nbori...@suse.com>
Reviewed-by: David Sterba <dste...@suse.com>
Signed-off-by: David Sterba <dste...@suse.com>
[bwh: Backported to 3.16:
 - btrfs_{abort,end}_transaction() take a pointer to btrfs_root
 - Adjust context]
Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
---
 fs/btrfs/ioctl.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -5077,15 +5077,11 @@ static long _btrfs_ioctl_set_received_su
                                          root->root_key.objectid);
                if (ret < 0 && ret != -EEXIST) {
                        btrfs_abort_transaction(trans, root, ret);
+                       btrfs_end_transaction(trans, root);
                        goto out;
                }
        }
        ret = btrfs_commit_transaction(trans, root);
-       if (ret < 0) {
-               btrfs_abort_transaction(trans, root, ret);
-               goto out;
-       }
-
 out:
        up_write(&root->fs_info->subvol_sem);
        mnt_drop_write_file(file);

Reply via email to