xfs
[Top] [All Lists]

[3.0-stable PATCH 25/36] xfs: Properly exclude IO type flags from buffer

To: stable@xxxxxxxxxxxxxxx
Subject: [3.0-stable PATCH 25/36] xfs: Properly exclude IO type flags from buffer flags
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Mon, 03 Dec 2012 17:42:33 -0600
Cc: xfs@xxxxxxxxxxx
References: <20121203144208.143464631@xxxxxxx>
User-agent: quilt/0.51-1
From: Dave Chinner <dchinner@xxxxxxxxxx>

Upstream commit: 12bcb3f7d4371f74bd25372e98e0d2da978e82b2

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>
Reviewed-by: Mark Tinguely <tinguely@xxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Ben Myers <bpm@xxxxxxx>
---
 fs/xfs/linux-2.6/xfs_buf.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: b/fs/xfs/linux-2.6/xfs_buf.c
===================================================================
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -177,9 +177,11 @@ 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_LOCK|XBF_MAPPED|XBF_DONT_BLOCK|XBF_READ_AHEAD);
+       flags &= ~(XBF_LOCK | XBF_MAPPED | XBF_DONT_BLOCK |
+                  XBF_TRYLOCK | XBF_ASYNC | XBF_READ_AHEAD);
 
        memset(bp, 0, sizeof(xfs_buf_t));
        atomic_set(&bp->b_hold, 1);


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