summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Blyakher <felixb@sgi.com>2009-06-01 13:13:24 -0500
committerFelix Blyakher <felixb@sgi.com>2009-06-01 22:59:45 -0500
commit1b17d766463d51904cb242f194a780737e5f73ef (patch)
tree25d43875b8c539d080141479a0695ab1ff24965c
parente6da7c9fed111ba1243297ee6eda8e24ae11c384 (diff)
downloadop-kernel-dev-1b17d766463d51904cb242f194a780737e5f73ef.zip
op-kernel-dev-1b17d766463d51904cb242f194a780737e5f73ef.tar.gz
xfs: prevent deadlock in xfs_qm_shake()
It's possible to recurse into filesystem from the memory allocation, which deadlocks in xfs_qm_shake(). Add check for __GFP_FS, and bail out if it is not set. Signed-off-by: Felix Blyakher <felixb@sgi.com> Signed-off-by: Hedi Berriche <hedi@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Felix Blyakher <felixb@sgi.com>
-rw-r--r--fs/xfs/linux-2.6/kmem.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h
index af6843c..179cbd6 100644
--- a/fs/xfs/linux-2.6/kmem.h
+++ b/fs/xfs/linux-2.6/kmem.h
@@ -103,7 +103,7 @@ extern void *kmem_zone_zalloc(kmem_zone_t *, unsigned int __nocast);
static inline int
kmem_shake_allow(gfp_t gfp_mask)
{
- return (gfp_mask & __GFP_WAIT) != 0;
+ return ((gfp_mask & __GFP_WAIT) && (gfp_mask & __GFP_FS));
}
#endif /* __XFS_SUPPORT_KMEM_H__ */
OpenPOWER on IntegriCloud