From: Dave Chinner Date: Mon, 23 Apr 2012 05:59:05 +0000 (+1000) Subject: xfs: Properly exclude IO type flags from buffer flags X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=12bcb3f7d4371f74bd25372e98e0d2da978e82b2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git xfs: Properly exclude IO type flags from buffer flags 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 Reviewed-by: Mark Tinguely Reviewed-by: Christoph Hellwig Signed-off-by: Ben Myers --- diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index af8480d5c71d..b2795bab1a01 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);