]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: reduce bmv_count in xfs_vn_fiemap
authorEric Sandeen <sandeen@sandeen.net>
Mon, 27 Jul 2009 02:52:01 +0000 (21:52 -0500)
committerFelix Blyakher <felixb@sgi.com>
Fri, 31 Jul 2009 05:56:58 +0000 (00:56 -0500)
commitb8d057caf5d06e3582a0032a61b6b31cbe0c3ae7
treef5735b99542d8d31dcad907294c5cf7a0657b563
parent85ae781da8e8da6327014c7778e6ef843b3b816b
xfs: reduce bmv_count in xfs_vn_fiemap

commit d2a22f48d05adb0d7f4052583f01eb47a8c8f72f caused
the full bmv_count's worth of getbmapx structures to get
allocated; telling it to do MAXEXTNUM was a bit insane,
resulting in ENOMEM every time.

Chop it down to something reasonable, the number of slots
in the caller's input buffer.  If this is too large the
caller may get ENOMEM but the reason should not be a
mystery, and they can try again with something smaller.

We add 1 to the value because in the normal getbmap
world, bmv_count includes the header and xfs_getbmap does:

        nex = bmv->bmv_count - 1;
        if (nex <= 0)
                return XFS_ERROR(EINVAL);

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