]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: add missing mutex_unlock in btrfs_relocate_sys_chunks()
authorDominique Martinet <dominique.martinet@atmark-techno.com>
Fri, 19 Apr 2024 02:22:48 +0000 (11:22 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 10:15:01 +0000 (12:15 +0200)
commit 9af503d91298c3f2945e73703f0e00995be08c30 upstream.

The previous patch that replaced BUG_ON by error handling forgot to
unlock the mutex in the error path.

Link: https://lore.kernel.org/all/Zh%2fHpAGFqa7YAFuM@duo.ucw.cz
Reported-by: Pavel Machek <pavel@denx.de>
Fixes: 7411055db5ce ("btrfs: handle chunk tree lookup error in btrfs_relocate_sys_chunks()")
CC: stable@vger.kernel.org
Reviewed-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/volumes.c

index cc3142d130be2389fbe7415c1e22c99c70b85dbd..3ebadc5ec8aeb3d6923775791967d449b67f5c83 100644 (file)
@@ -3456,6 +3456,7 @@ again:
                         * alignment and size).
                         */
                        ret = -EUCLEAN;
+                       mutex_unlock(&fs_info->reclaim_bgs_lock);
                        goto error;
                }