btrfs: simplify mutex unlocking code in btrfs_commit_transaction
authorAnand Jain <Anand.Jain@oracle.com>
Wed, 20 Dec 2017 06:42:26 +0000 (14:42 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 22 Jan 2018 15:08:20 +0000 (16:08 +0100)
No functional change rearrange the mutex_unlock.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
[ edit subject ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/transaction.c

index 6348573e26a72e04bdcb599b20ff1a70a7070d40..04f07144b45ce265b36af2754455accc89954005 100644 (file)
@@ -2265,16 +2265,13 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
        }
 
        ret = write_all_supers(fs_info, 0);
-       if (ret) {
-               mutex_unlock(&fs_info->tree_log_mutex);
-               goto scrub_continue;
-       }
-
        /*
         * the super is written, we can safely allow the tree-loggers
         * to go about their business
         */
        mutex_unlock(&fs_info->tree_log_mutex);
+       if (ret)
+               goto scrub_continue;
 
        btrfs_finish_extent_commit(trans, fs_info);