From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp1040.oracle.com ([156.151.31.81]:43543 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186AbdH2StX (ORCPT ); Tue, 29 Aug 2017 14:49:23 -0400 Date: Tue, 29 Aug 2017 11:49:13 -0700 From: "Darrick J. Wong" Subject: Re: [PATCH v2 3/9] xfs: ordered buffer log items are never formatted Message-ID: <20170829184913.GC4757@magnolia> References: <20170829143758.58990-1-bfoster@redhat.com> <20170829143758.58990-4-bfoster@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170829143758.58990-4-bfoster@redhat.com> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Brian Foster Cc: linux-xfs@vger.kernel.org On Tue, Aug 29, 2017 at 10:37:52AM -0400, Brian Foster wrote: > Ordered buffers pass through the logging infrastructure without ever > being written to the log. The way this works is that the ordered > buffer status is transferred to the log vector at commit time via > the ->iop_size() callback. In xlog_cil_insert_format_items(), > ordered log vectors bypass ->iop_format() processing altogether. > > Therefore it is unnecessary for xfs_buf_item_format() to handle > ordered buffers. Remove the unnecessary logic and assert that an > ordered buffer never reaches this point. > > Signed-off-by: Brian Foster > Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong > --- > fs/xfs/xfs_buf_item.c | 12 ++---------- > fs/xfs/xfs_trace.h | 1 - > 2 files changed, 2 insertions(+), 11 deletions(-) > > diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c > index ff076d1..ef2c137 100644 > --- a/fs/xfs/xfs_buf_item.c > +++ b/fs/xfs/xfs_buf_item.c > @@ -323,6 +323,8 @@ xfs_buf_item_format( > ASSERT((bip->bli_flags & XFS_BLI_STALE) || > (xfs_blft_from_flags(&bip->__bli_format) > XFS_BLFT_UNKNOWN_BUF > && xfs_blft_from_flags(&bip->__bli_format) < XFS_BLFT_MAX_BUF)); > + ASSERT(!(bip->bli_flags & XFS_BLI_ORDERED) || > + (bip->bli_flags & XFS_BLI_STALE)); > > > /* > @@ -347,16 +349,6 @@ xfs_buf_item_format( > bip->bli_flags &= ~XFS_BLI_INODE_BUF; > } > > - if ((bip->bli_flags & (XFS_BLI_ORDERED|XFS_BLI_STALE)) == > - XFS_BLI_ORDERED) { > - /* > - * The buffer has been logged just to order it. It is not being > - * included in the transaction commit, so don't format it. > - */ > - trace_xfs_buf_item_format_ordered(bip); > - return; > - } > - > for (i = 0; i < bip->bli_format_count; i++) { > xfs_buf_item_format_segment(bip, lv, &vecp, offset, > &bip->bli_formats[i]); > diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h > index 6881047..e839ab4 100644 > --- a/fs/xfs/xfs_trace.h > +++ b/fs/xfs/xfs_trace.h > @@ -517,7 +517,6 @@ DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size); > DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered); > DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale); > DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format); > -DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered); > DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale); > DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered); > DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin); > -- > 2.9.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html