xfs
[Top] [All Lists]

[PATCH 35/37] xfs: Properly exclude IO type flags from buffer flags

To: xfs@xxxxxxxxxxx
Subject: [PATCH 35/37] xfs: Properly exclude IO type flags from buffer flags
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 23 Apr 2012 15:59:05 +1000
In-reply-to: <1335160747-17254-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1335160747-17254-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

Recent event tracing during a debugging session showed that flags
that define the IO type for a buffer are leaking into the flags on
the buffer incorrectly. Fix the flag exclusion mask in
xfs_buf_alloc() to avoid problems that may be caused by such
leakage.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
 fs/xfs/xfs_buf.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index af8480d..b2795ba 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -178,9 +178,10 @@ xfs_buf_alloc(
                return NULL;
 
        /*
-        * We don't want certain flags to appear in b_flags.
+        * We don't want certain flags to appear in b_flags unless they are
+        * specifically set by later operations on the buffer.
         */
-       flags &= ~(XBF_MAPPED|XBF_READ_AHEAD);
+       flags &= ~(XBF_MAPPED | XBF_TRYLOCK | XBF_ASYNC | XBF_READ_AHEAD);
 
        atomic_set(&bp->b_hold, 1);
        atomic_set(&bp->b_lru_ref, 1);
-- 
1.7.9.5

<Prev in Thread] Current Thread [Next in Thread>