]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dax: don't abuse get_block mapping for endio callbacks
authorDave Chinner <dchinner@redhat.com>
Wed, 3 Jun 2015 23:18:18 +0000 (09:18 +1000)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:49 +0000 (15:45 -0700)
commit5f187344963c1878901b6482e14ca53d4cb73b05
tree83c6b45dca365fca6ff219a2d3c3c30dda4b49b0
parent1e8ecfc0c083f3e9114d584e95894caabea3793b
dax: don't abuse get_block mapping for endio callbacks

Orabug: 23331020

[ Upstream commit e842f2903908934187af7232fb5b21da527d1757 ]

dax_fault() currently relies on the get_block callback to attach an
io completion callback to the mapping buffer head so that it can
run unwritten extent conversion after zeroing allocated blocks.

Instead of this hack, pass the conversion callback directly into
dax_fault() similar to the get_block callback. When the filesystem
allocates unwritten extents, it will set the buffer_unwritten()
flag, and hence the dax_fault code can call the completion function
in the contexts where it is necessary without overloading the
mapping buffer head.

Note: The changes to ext4 to use this interface are suspect at best.
In fact, the way ext4 did this end_io assignment in the first place
looks suspect because it only set a completion callback when there
wasn't already some other write() call taking place on the same
inode. The ext4 end_io code looks rather intricate and fragile with
all it's reference counting and passing to different contexts for
modification via inode private pointers that aren't protected by
locks...

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 0e3029cfab4a7884b32e1b2d3c19c12eded9804a)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
fs/dax.c
fs/ext2/file.c
fs/ext4/file.c
fs/ext4/inode.c
include/linux/fs.h