]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: Make fiemap work in query mode.
authorTao Ma <tao.ma@oracle.com>
Thu, 29 Apr 2010 05:13:56 +0000 (15:13 +1000)
committerAlex Elder <aelder@sgi.com>
Wed, 19 May 2010 14:58:16 +0000 (09:58 -0500)
commit9192a6cd2090b3d4d7887ed0067251b6ab5db246
tree1112feee61ad0c7653c6877d04397b4949c46471
parent182e3fbabcaff68821a055b612e2904e46f0b3c2
xfs: Make fiemap work in query mode.

According to Documentation/filesystems/fiemap.txt, If fm_extent_count
is zero, then the fm_extents[] array is ignored (no extents will be
returned), and the fm_mapped_extents count will hold the number of
extents needed.

But as the commit b8d057caf5d06e3582a0032a61b6b31cbe0c3ae7 has changed
bmv_count to the caller's input buffer, this number query function can't
work any more. As this commit is written to change bmv_count from
MAXEXTNUM because of ENOMEM.

This patch just try to  set bm.bmv_count to something sane.
Thanks to Dave Chinner <david@fromorbit.com> for the suggestion.

Cc: Eric Sandeen <sandeen@redhat.com>
Cc: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Tao Ma <tao.ma@oracle.com>
fs/xfs/linux-2.6/xfs_iops.c