Btrfs: avoid deadlocks from GFP_KERNEL allocations during btrfs_real_readdir
authorChris Mason <chris.mason@oracle.com>
Fri, 27 Apr 2012 18:23:22 +0000 (14:23 -0400)
committerChris Mason <chris.mason@oracle.com>
Fri, 27 Apr 2012 18:23:22 +0000 (14:23 -0400)
commit8bbc2d98d85c1f7df4c0b1a7c14cac5620b27037
tree86e59f6bf94ad77c2fa1b232faa8f8b63b8675cb
parentd53c3749e0d831eeb912cd0d16ccbbf51781fa1d
Btrfs: avoid deadlocks from GFP_KERNEL allocations during btrfs_real_readdir

Btrfs has an optimization where it will preallocate dentries during
readdir to fill in enough information to open the inode without an extra
lookup.

But, we're calling d_alloc, which is doing GFP_KERNEL allocations, and
that leads to deadlocks because our readdir code has tree locks held.

For now, disable this optimization.  We'll fix the gfp mask in the next
merge window.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c