]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: fix getbmap vs mmap deadlock
authorChristoph Hellwig <hch@infradead.org>
Tue, 24 Feb 2009 13:39:02 +0000 (08:39 -0500)
committerFelix Blyakher <felixb@sgi.com>
Thu, 30 Apr 2009 05:29:02 +0000 (00:29 -0500)
commitbddc00d4d7ffb67f231a3029adb96be612a153c0
tree234d0754b9a5c9bc3b0ae890eeef57aa7d1ee29e
parent62d806823a06ee813771de96ffdec56149bd691a
xfs: fix getbmap vs mmap deadlock

xfs_getbmap (or rather the formatters called by it) copy out the getbmap
structures under the ilock, which can deadlock against mmap.  This has
been reported via bugzilla a while ago (#717) and has recently also
shown up via lockdep.

So allocate a temporary buffer to format the kernel getbmap structures
into and then copy them out after dropping the locks.

A little problem with this is that we limit the number of extents we
can copy out by the maximum allocation size, but I see no real way
around that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Felix Blyakher <felixb@sgi.com>
Signed-off-by: Felix Blyakher <felixb@sgi.com>
fs/xfs/xfs_bmap.c