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)
commitfede766f28dd766d4e8feb321fdb19edb21ef6fb
tree86e59f6bf94ad77c2fa1b232faa8f8b63b8675cb
parent7654b72417e10e294563496e25211200f9b8b6d3
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