From patchwork Mon Aug 29 18:42:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 1110162 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7TIgcqr014574 for ; Mon, 29 Aug 2011 18:43:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754512Ab1H2Smf (ORCPT ); Mon, 29 Aug 2011 14:42:35 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49790 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754324Ab1H2Smf (ORCPT ); Mon, 29 Aug 2011 14:42:35 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 3D218890B6 for ; Mon, 29 Aug 2011 20:42:34 +0200 (CEST) Received: by ds.suse.cz (Postfix, from userid 10065) id E6FEC75579; Mon, 29 Aug 2011 20:42:33 +0200 (CEST) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH debug] btrfs: ratelimit WARN_ON in use_block_rsv Date: Mon, 29 Aug 2011 20:42:32 +0200 Message-Id: <1314643352-10195-1-git-send-email-dsterba@suse.cz> X-Mailer: git-send-email 1.7.6.233.gd79bc In-Reply-To: <4E52109A.3090403@itwm.fraunhofer.de> References: <4E52109A.3090403@itwm.fraunhofer.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 29 Aug 2011 18:44:02 +0000 (UTC) A debugging helper, not really intended for merge. From: David Sterba Signed-off-by: David Sterba --- fs/btrfs/extent-tree.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 44a3107..c5c1e7d 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "compat.h" #include "hash.h" #include "ctree.h" @@ -5703,7 +5704,13 @@ use_block_rsv(struct btrfs_trans_handle *trans, if (!ret) return block_rsv; if (ret) { - WARN_ON(1); + static DEFINE_RATELIMIT_STATE(_rs, + DEFAULT_RATELIMIT_INTERVAL, + /*DEFAULT_RATELIMIT_BURST*/ 2); + if (__ratelimit(&_rs)) { + printk(KERN_DEBUG "btrfs: block rsv returned %d\n", ret); + WARN_ON(1); + } ret = reserve_metadata_bytes(trans, root, block_rsv, blocksize, 0); if (!ret) {