From patchwork Wed May 2 08:01:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 10375205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D9EDB6037D for ; Wed, 2 May 2018 08:02:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD33C28C91 for ; Wed, 2 May 2018 08:02:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C242A28D97; Wed, 2 May 2018 08:02:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D69F28C91 for ; Wed, 2 May 2018 08:02:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750897AbeEBICR (ORCPT ); Wed, 2 May 2018 04:02:17 -0400 Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:39303 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751371AbeEBICJ (ORCPT ); Wed, 2 May 2018 04:02:09 -0400 Received: from ppp59-167-129-252.static.internode.on.net (HELO dastard) ([59.167.129.252]) by ipmail07.adl2.internode.on.net with ESMTP; 02 May 2018 17:32:04 +0930 Received: from discord.disaster.area ([192.168.1.111]) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1fDmi8-0002X2-AL for linux-xfs@vger.kernel.org; Wed, 02 May 2018 18:02:00 +1000 Received: from dave by discord.disaster.area with local (Exim 4.91) (envelope-from ) id 1fDmi8-0003BC-8T for linux-xfs@vger.kernel.org; Wed, 02 May 2018 18:02:00 +1000 From: Dave Chinner To: linux-xfs@vger.kernel.org Subject: [PATCH 09/10] xfs: add some more debug checks to buffer log item reuse Date: Wed, 2 May 2018 18:01:56 +1000 Message-Id: <20180502080157.11386-10-david@fromorbit.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180502080157.11386-1-david@fromorbit.com> References: <20180502080157.11386-1-david@fromorbit.com> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dave Chinner Just to make sure the item isn't associated with another transaction when we try to reuse it. Signed-Off-By: Dave Chinner Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_buf_item.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 53c07a7a14fb..3656f7cb18ad 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -722,8 +722,11 @@ xfs_buf_item_init( * nothing to do here so return. */ ASSERT(bp->b_target->bt_mount == mp); - if (bip != NULL) { + if (bip) { ASSERT(bip->bli_item.li_type == XFS_LI_BUF); + ASSERT(!test_bit(XFS_LI_TRANS, &bip->bli_item.li_flags)); + ASSERT(!bp->b_transp); + ASSERT(bip->bli_buf == bp); return 0; }