OSDN Git Service

xfs: add some more debug checks to buffer log item reuse
authorDave Chinner <dchinner@redhat.com>
Wed, 9 May 2018 14:49:10 +0000 (07:49 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 10 May 2018 15:56:46 +0000 (08:56 -0700)
Just to make sure the item isn't associated with another
transaction when we try to reuse it.

Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_buf_item.c

index df62082..8d6ed04 100644 (file)
@@ -745,8 +745,10 @@ 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(!bp->b_transp);
+               ASSERT(bip->bli_buf == bp);
                return 0;
        }