1 ext4: fix DAX write locking
3 From: Christoph Hellwig <hch@lst.de>
5 Unlike O_DIRECT DAX is not an optional opt-in feature selected by the
6 application, so we'll have to provide the traditional synchronŃ–zation
7 of overlapping writes as we do for buffered writes.
9 This was broken historically for DAX, but got fixed for ext2 and XFS
10 as part of the iomap conversion. Fix up ext4 as well.
12 Signed-off-by: Christoph Hellwig <hch@lst.de>
13 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14 Reviewed-by: Jan Kara <jack@suse.cz>
16 fs/ext4/file.c | 10 +---------
17 1 file changed, 1 insertion(+), 9 deletions(-)
19 diff --git a/fs/ext4/file.c b/fs/ext4/file.c
20 index d663d3d..a1e88aa 100644
23 @@ -175,7 +175,6 @@ ext4_dax_write_iter(struct kiocb *iocb, struct iov_iter *from)
25 struct inode *inode = file_inode(iocb->ki_filp);
27 - bool overwrite = false;
30 ret = ext4_write_checks(iocb, from);
31 @@ -188,16 +187,9 @@ ext4_dax_write_iter(struct kiocb *iocb, struct iov_iter *from)
35 - if (ext4_overwrite_io(inode, iocb->ki_pos, iov_iter_count(from))) {
37 - downgrade_write(&inode->i_rwsem);
39 ret = dax_iomap_rw(iocb, from, &ext4_iomap_ops);
42 - inode_unlock(inode);
44 - inode_unlock_shared(inode);
45 + inode_unlock(inode);
47 ret = generic_write_sync(iocb, ret);
53 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
54 the body of a message to majordomo@vger.kernel.org
55 More majordomo info at http://vger.kernel.org/majordomo-info.html