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>
        }
 
        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);