[PATCH 2/2] xfs: fix getbmap vs mmap deadlock

Felix Blyakher felixb at sgi.com
Thu Apr 16 11:05:46 CDT 2009


On Apr 9, 2009, at 12:14 PM, Christoph Hellwig wrote:

> On Mon, Apr 06, 2009 at 07:42:57PM -0500, Felix Blyakher wrote:
>> Actually with the patch we either get all requested extents, or none
>> if we fail to get memory for them.
>> Should we teach the callers to expect ENOMEM and repeat the call
>> to xfs_getbmap with smaller number of extents?
>
> The problem with any of that is that we don't actually get the exact
> extent list but always a racy version.

Agree, but the alternative is ENOMEM, i.e. no bmap
at all.
Since the callers of xfs_getbmap are only ioctl's from
the user apps, we can move the logic of retrying the
call with the smaller number of extents to the app with
the understanding that it may not be exact snapshot of
the file's extents on a very active file. That would mean
that your change in kernel is good as is, but the API for
the GETBMAP[X] is changing by allowing ENOMEM returned.
We'll need to update the man page, and add ENOMEM handling
to xfs_bmap/xfs_io.

Felix




More information about the xfs mailing list