All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ashish Samant <ashish.samant@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: [PATCH V3] btrfs: Print Warning only if ENOSPC_DEBUG is enabled
Date: Fri, 11 Mar 2016 14:54:05 -0800	[thread overview]
Message-ID: <1457736845-27783-1-git-send-email-ashish.samant@oracle.com> (raw)

Dont print warning for ENOSPC error unless ENOSPC_DEBUG is enabled. Use 
btrfs_debug if it is enabled.

Signed-off-by: Ashish Samant <ashish.samant@oracle.com>

V3:
 - Use btrfs_debug() instead of WARN() per David Sterba's comment.
V2:
 - Add a commit message.
---
 fs/btrfs/delayed-inode.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index b57daa8..b7e44cc 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -651,9 +651,12 @@ 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\n", ret);
 		/*
 		 * Ok this is a problem, let's just steal from the global rsv
 		 * since this really shouldn't happen that often.
-- 
1.9.1


             reply	other threads:[~2016-03-11 22:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 22:54 Ashish Samant [this message]
2016-03-14 13:52 ` [PATCH V3] btrfs: Print Warning only if ENOSPC_DEBUG is enabled David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457736845-27783-1-git-send-email-ashish.samant@oracle.com \
    --to=ashish.samant@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.