public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED?
@ 2008-08-25 22:12 Nathaniel W. Turner
  2008-08-25 23:16 ` Eric Sandeen
  2008-08-26  2:09 ` Dave Chinner
  0 siblings, 2 replies; 3+ messages in thread
From: Nathaniel W. Turner @ 2008-08-25 22:12 UTC (permalink / raw)
  To: xfs

Hi folks,

While doing a little light reading, I noticed the following in 
fs/xfs/xfs_log.c:1011 (in the 2.6.26.3 Linux kernel tree).  Am I missing 
something, or should XFS_BUF_ORDERED be replaced with XFS_BUF_ISORDERED 
in this check?

nate


        /*
         * If the ordered flag has been removed by a lower
         * layer, it means the underlyin device no longer supports
         * barrier I/O. Warn loudly and turn off barriers.
         */
        if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && 
!XFS_BUF_ORDERED(bp)) {
                l->l_mp->m_flags &= ~XFS_MOUNT_BARRIER;
                xfs_fs_cmn_err(CE_WARN, l->l_mp,
                                "xlog_iodone: Barriers are no longer 
supported"
                                " by device. Disabling barriers\n");
                xfs_buftrace("XLOG_IODONE BARRIERS OFF", bp);
        }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED?
  2008-08-25 22:12 XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED? Nathaniel W. Turner
@ 2008-08-25 23:16 ` Eric Sandeen
  2008-08-26  2:09 ` Dave Chinner
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2008-08-25 23:16 UTC (permalink / raw)
  To: Nathaniel W. Turner; +Cc: xfs

Nathaniel W. Turner wrote:
> Hi folks,
> 
> While doing a little light reading, I noticed the following in 
> fs/xfs/xfs_log.c:1011 (in the 2.6.26.3 Linux kernel tree).  Am I missing 
> something, or should XFS_BUF_ORDERED be replaced with XFS_BUF_ISORDERED 
> in this check?
> 
> nate
> 
> 
>         /*
>          * If the ordered flag has been removed by a lower
>          * layer, it means the underlyin device no longer supports
>          * barrier I/O. Warn loudly and turn off barriers.
>          */
>         if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && 
> !XFS_BUF_ORDERED(bp)) {
>                 l->l_mp->m_flags &= ~XFS_MOUNT_BARRIER;
>                 xfs_fs_cmn_err(CE_WARN, l->l_mp,
>                                 "xlog_iodone: Barriers are no longer 
> supported"
>                                 " by device. Disabling barriers\n");
>                 xfs_buftrace("XLOG_IODONE BARRIERS OFF", bp);
>         }
> 
> 

wow, I think you're right.

Fortunately I dont' think this does much harm in most cases - the buffer
is usually ordered here anyway, and we're re-setting it instead of
testing it, as you noticed.  But it's making this whole
dynamic-lack-of-barrier detection pointless/broken.

modest proposal:  change the macro (and friends) to XFS_BUF_SETORDERED
or somesuch.  :)

-Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED?
  2008-08-25 22:12 XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED? Nathaniel W. Turner
  2008-08-25 23:16 ` Eric Sandeen
@ 2008-08-26  2:09 ` Dave Chinner
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2008-08-26  2:09 UTC (permalink / raw)
  To: Nathaniel W. Turner; +Cc: xfs

On Mon, Aug 25, 2008 at 06:12:06PM -0400, Nathaniel W. Turner wrote:
> Hi folks,
>
> While doing a little light reading, I noticed the following in  
> fs/xfs/xfs_log.c:1011 (in the 2.6.26.3 Linux kernel tree).  Am I missing  
> something, or should XFS_BUF_ORDERED be replaced with XFS_BUF_ISORDERED  
> in this check?

Yes, it is wrong. Well spotted. I guess this shows that I was right
when I complained about needing this untestable barrier handling
code in every filesystem....

Patch below.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com


XFS: Fix barrier status change detection

The current code in xlog_iodone() uses the wrong macro
to check if the barrier has been cleared due to an EOPNOTSUPP
error form the lower layer.

Signed-off-by: Dave Chinner <david@fromorbit.com>
---
 fs/xfs/xfs_log.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index ccba14e..ff2ac20 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1009,7 +1009,7 @@ xlog_iodone(xfs_buf_t *bp)
 	 * layer, it means the underlyin device no longer supports
 	 * barrier I/O. Warn loudly and turn off barriers.
 	 */
-	if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && !XFS_BUF_ORDERED(bp)) {
+	if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && !XFS_BUF_ISORDERED(bp)) {
 		l->l_mp->m_flags &= ~XFS_MOUNT_BARRIER;
 		xfs_fs_cmn_err(CE_WARN, l->l_mp,
 				"xlog_iodone: Barriers are no longer supported"

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-26  2:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-25 22:12 XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED? Nathaniel W. Turner
2008-08-25 23:16 ` Eric Sandeen
2008-08-26  2:09 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox