Skip to content

Commit

Permalink
xfs: prevent deadlock in xfs_qm_shake()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Hedi Berriche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Andi Kleen <[email protected]>
Signed-off-by: Felix Blyakher <[email protected]>
  • Loading branch information
Felix Blyakher committed Jun 2, 2009
1 parent e6da7c9 commit 1b17d76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/xfs/linux-2.6/kmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

0 comments on commit 1b17d76

Please sign in to comment.