Re: [PATCH 5/5] xfs: assert that we hold the ilock for extent map access

Christoph Hellwig
2013-12-05T21:22:20Z

On Fri, Dec 06, 2013 at 08:10:47AM +1100, Dave Chinner wrote:
> Looks good, but can we add an assert to xfs_bunmapi() at the same
> time just to cover all the public bmapi interfaces with locking
> requirements?

Sure, will do.

Btw, I got another idea to sort this mess out a bit better:

- add a new XFS_ILOCK_BMAP flag, and fold the bmap locking magic
into xfs_ilock.
- because the flag is now passed down we can assert that it is
passed in xfs_bmapi_read and friends even if the extent list
is already read in and thus improve coverage.

The downside is another two branches in the common ilock code path.