• Eric Sandeen's avatar
    xfs: reduce bmv_count in xfs_vn_fiemap · 97db39a1
    Eric Sandeen authored
    commit 6321e3ed 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: default avatarEric Sandeen <sandeen@sandeen.net>
    Reviewed-by: default avatarOlaf Weber <olaf@sgi.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarFelix Blyakher <felixb@sgi.com>
    97db39a1
xfs_iops.c 20 KB