Linux Kernels

Btrfs: Add check for null block group to find_search_start

This change “Btrfs: Add check for null block group to find_search_start” (commit 0e4de58) in Linux kernel is authored by Chris Mason <chris.mason [at] oracle.com> on Mon Nov 26 10:55:49 2007 -0500.

Description of "Btrfs: Add check for null block group to find_search_start"

The change “Btrfs: Add check for null block group to find_search_start” introduces changes as follows.

Btrfs: Add check for null block group to find_search_start

Signed-off-by: Chris Mason <chris.mason@oracle.com>

Linux kernel releases containing commit 0e4de58

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "Btrfs: Add check for null block group to find_search_start"

There are 3 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 fs/btrfs/extent-tree.c | 3 +++
 1 file changed, 3 insertions(+)
 
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 6a7a9ba75fd9..39be6baccc36 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -204,6 +204,7 @@ static u64 find_search_start(struct btrfs_root *root,
 wrapped:
 	cache = btrfs_lookup_block_group(root->fs_info, last);
 	if (!cache) {
+no_cache:
 		if (!wrapped) {
 			wrapped = 1;
 			last = search_start;
@@ -219,6 +220,8 @@ static u64 find_search_start(struct btrfs_root *root,
 	}
 	if (!full_scan)
 		cache = btrfs_find_block_group(root, cache, last, data, 0);
+	if (!cache)
+		goto no_cache;
 	*cache_ret = cache;
 	cache_miss = 0;
 	goto again;

The commit for this change in Linux stable tree is 0e4de58 (patch).

Last modified: 2020/01/11 09:27