diff mbox

btrfs: add ENOSPC check for temporarily allocated btrfs_block_rsv

Message ID 20160829113632.24193-1-wangxg.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Xiaoguang Wang Aug. 29, 2016, 11:36 a.m. UTC
Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
---
 fs/btrfs/extent-tree.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 56a9c59..602e410 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5552,6 +5552,9 @@  void btrfs_free_block_rsv(struct btrfs_root *root,
 	if (!rsv)
 		return;
 	btrfs_block_rsv_release(root, rsv, (u64)-1);
+
+	WARN_ON(rsv->size > 0);
+	WARN_ON(rsv->reserved > 0);
 	kfree(rsv);
 }