From 2e3fcb1ccdbe7918006d509a531fcf8c9b10e9f8 Mon Sep 17 00:00:00 2001 From: Ashish Samant Date: Fri, 11 Mar 2016 14:54:05 -0800 Subject: [PATCH] btrfs: Print Warning only if ENOSPC_DEBUG is enabled Dont print warning for ENOSPC error unless ENOSPC_DEBUG is enabled. Use btrfs_debug if it is enabled. Signed-off-by: Ashish Samant [ preserve the WARN_ON ] Signed-off-by: David Sterba --- fs/btrfs/delayed-inode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index a20d541bb190..6cef0062f929 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -650,9 +650,14 @@ static int btrfs_delayed_inode_reserve_metadata( goto out; ret = btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes); - if (!WARN_ON(ret)) + if (!ret) goto out; + if (btrfs_test_opt(root, ENOSPC_DEBUG)) { + btrfs_debug(root->fs_info, + "block rsv migrate returned %d", ret); + WARN_ON(1); + } /* * Ok this is a problem, let's just steal from the global rsv * since this really shouldn't happen that often. -- 2.39.5