From: Josef Bacik <jbacik@fb.com>
To: Liu Bo <bo.li.liu@oracle.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: use WARN_ON_ONCE instead for btrfs_invalidate_inodes
Date: Sat, 4 Jan 2014 19:40:23 -0500 [thread overview]
Message-ID: <52C8A9F7.6080701@fb.com> (raw)
In-Reply-To: <1388389874-29141-1-git-send-email-bo.li.liu@oracle.com>
On 12/30/2013 02:51 AM, Liu Bo wrote:
> So after transaction is aborted, we need to cleanup inode resources by
> calling btrfs_invalidate_inodes(), and btrfs_invalidate_inodes() hopes
> roots' refs to be zero in old times and sets a WARN_ON(), however, this
> is not always true within cleaning up transaction, so WARN_ON_ONCE() is
> better, and we won't get another syslog message bomb.
>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
> fs/btrfs/inode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index f1a7744..ef7f6af 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -4761,7 +4761,7 @@ void btrfs_invalidate_inodes(struct btrfs_root *root)
> struct inode *inode;
> u64 objectid = 0;
>
> - WARN_ON(btrfs_root_refs(&root->root_item) != 0);
> + WARN_ON_ONCE(btrfs_root_refs(&root->root_item) != 0);
>
> spin_lock(&root->inode_lock);
> again:
I'd rather just detect that we're cleaning up for an abort and not warn
at all. Thanks,
Josef
next prev parent reply other threads:[~2014-01-05 0:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-30 7:51 [PATCH] Btrfs: use WARN_ON_ONCE instead for btrfs_invalidate_inodes Liu Bo
2014-01-05 0:40 ` Josef Bacik [this message]
2014-02-10 9:37 ` [PATCH v2] Btrfs: avoid warning bomb of btrfs_invalidate_inodes Liu Bo
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=52C8A9F7.6080701@fb.com \
--to=jbacik@fb.com \
--cc=bo.li.liu@oracle.com \
--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.