]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ext2: Add locking for DAX faults
authorRoss Zwisler <ross.zwisler@linux.intel.com>
Tue, 13 Oct 2015 22:25:37 +0000 (16:25 -0600)
committerDan Duval <dan.duval@oracle.com>
Wed, 7 Dec 2016 17:19:59 +0000 (12:19 -0500)
commit7b3e076ec170bf578bbee81d61d5f699a6164a1a
treec300007770e38568f1f890031aa5be6a3517a809
parenta9b062aa4b6d5d9afee1f2718b5dc6086af0170b
ext2: Add locking for DAX faults

Orabug: 22913653

Add locking to ensure that DAX faults are isolated from ext2 operations
that modify the data blocks allocation for an inode.  This is intended to
be analogous to the work being done in XFS by Dave Chinner:

http://www.spinics.net/lists/linux-fsdevel/msg90260.html

Compared with XFS the ext2 case is greatly simplified by the fact that ext2
already allocates and zeros new blocks before they are returned as part of
ext2_get_block(), so DAX doesn't need to worry about getting unmapped or
unwritten buffer heads.

This means that the only work we need to do in ext2 is to isolate the DAX
faults from inode block allocation changes.  I believe this just means that
we need to isolate the DAX faults from truncate operations.

The newly introduced dax_sem is intended to replicate the protection
offered by i_mmaplock in XFS.  In addition to truncate the i_mmaplock also
protects XFS operations like hole punching, fallocate down, extent
manipulation IOCTLS like xfs_ioc_space() and extent swapping.  Truncate is
the only one of these operations supported by ext2.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Jan Kara <jack@suse.com>
(cherry picked from commit 5726b27b09cc92452b543764899a07e7c8037edd)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
fs/ext2/ext2.h
fs/ext2/file.c
fs/ext2/inode.c
fs/ext2/super.c