[PATCH for-next 2/3] btrfs: properly unlock log_mutex in error case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We need to unlock log_root_tree->log_mutex in case of an error.

Fixes: 122cfba0d2eb ("btrfs: reorder log node allocation")
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Julia Lawall <julia.lawall@xxxxxxx>
Signed-off-by: Naohiro Aota <naohiro.aota@xxxxxxx>
---
 fs/btrfs/tree-log.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 1dd7e34fe484..ed101420934c 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3164,6 +3164,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
 		ret = btrfs_alloc_log_tree_node(trans, log_root_tree);
 		if (ret) {
 			mutex_unlock(&fs_info->tree_log_mutex);
+			mutex_unlock(&log_root_tree->log_mutex);
 			goto out;
 		}
 	}
-- 
2.30.0




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux