Skip to content

Commit

Permalink
xfs: Properly exclude IO type flags from buffer flags
Browse files Browse the repository at this point in the history
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@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
  • Loading branch information
Dave Chinner authored and Ben Myers committed May 14, 2012
1 parent ad1e95c commit 12bcb3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/xfs/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 12bcb3f

Please sign in to comment.