xfs: fallback to vmalloc for large buffers in xfs_getbmap
authorDave Chinner <dchinner@redhat.com>
Wed, 7 Mar 2012 04:50:22 +0000 (04:50 +0000)
committerBen Myers <bpm@sgi.com>
Thu, 15 Mar 2012 19:54:23 +0000 (14:54 -0500)
commitf074211f6041305b645669464343d504f4e6a290
tree2fd1678c72b47683e25f69e247dfecaec79e477b
parentad650f5b27bc9858360b42aaa0d9204d16115316
xfs: fallback to vmalloc for large buffers in xfs_getbmap

xfs_getbmap uses for a large buffer for extents, which is kmalloc'd.
This can fail after the system has been running for some time as it
is a high order allocation. Add a fallback to vmalloc so that it
doesn't require contiguous memory and so won't randomly fail on
files with large extent lists.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_bmap.c