浏览代码

Btrfs: confirmation of value is added before trace_btrfs_get_extent() is called

We should confirm the value of extent_map before calling
trace_btrfs_get_extent() because the value of extent_map has the
possibility of NULL.

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Tsutomu Itoh 12 年之前
父节点
当前提交
f0bd95ea72
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      fs/btrfs/inode.c

+ 2 - 1
fs/btrfs/inode.c

@@ -5505,7 +5505,8 @@ insert:
 	write_unlock(&em_tree->lock);
 	write_unlock(&em_tree->lock);
 out:
 out:
 
 
-	trace_btrfs_get_extent(root, em);
+	if (em)
+		trace_btrfs_get_extent(root, em);
 
 
 	if (path)
 	if (path)
 		btrfs_free_path(path);
 		btrfs_free_path(path);