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>

+1 -1
+1 -1
fs/xfs/linux-2.6/kmem.h
··· 103 103 static inline int 104 104 kmem_shake_allow(gfp_t gfp_mask) 105 105 { 106 - return (gfp_mask & __GFP_WAIT) != 0; 106 + return ((gfp_mask & __GFP_WAIT) && (gfp_mask & __GFP_FS)); 107 107 } 108 108 109 109 #endif /* __XFS_SUPPORT_KMEM_H__ */