]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
Fix a direct I/O locking issue revealed by the new mutex code.
authorNathan Scott <nathans@bruce>
Wed, 15 Mar 2006 04:14:45 +0000 (15:14 +1100)
committerNathan Scott <nathans@bruce>
Wed, 15 Mar 2006 04:14:45 +0000 (15:14 +1100)
commit3fb962bde48c413bfa419ec4413037e87955dcb6
treeccce49b3fbdd8a3f38bbfd07a397092a3ae483b5
parent3759fa9c55923f719ae944a3f8fbb029b36f759d
Fix a direct I/O locking issue revealed by the new mutex code.
Affects only XFS (i.e. DIO_OWN_LOCKING case) - currently it is
not possible to get i_mutex locking correct when using DIO_OWN
direct I/O locking in a filesystem due to indeterminism in the
possible return code/lock/unlock combinations.  This can cause
a direct read to attempt a double i_mutex unlock inside XFS.

We're now ensuring __blockdev_direct_IO always exits with the
inode i_mutex (still) held for a direct reader.

Tested with the three different locking modes (via direct block
device access, ext3 and XFS) - both reading and writing; cannot
find any regressions resulting from this change, and it clearly
fixes the mutex_unlock warning originally reported here:
http://marc.theaimsgroup.com/?l=linux-kernel&m=114189068126253&w=2

Signed-off-by: Nathan Scott <nathans@sgi.com>
Acked-by: Christoph Hellwig <hch@lst.de>
fs/direct-io.c