* [to-be-updated] ext4-nowait-aio-support.patch removed from -mm tree
@ 2017-06-16 20:00 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2017-06-16 20:00 UTC (permalink / raw)
To: rgoldwyn, adilger.kernel, axboe, clm, darrick.wong, dsterba, hch,
jack, jbacik, tytso, viro, mm-commits
The patch titled
Subject: ext4: nowait aio support
has been removed from the -mm tree. Its filename was
ext4-nowait-aio-support.patch
This patch was dropped because an updated version will be merged
------------------------------------------------------
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: ext4: nowait aio support
Return EAGAIN if any of the following checks fail for direct I/O:
+ i_rwsem is lockable
+ Writing beyond end of file (will trigger allocation)
+ Blocks are not allocated at the write location
Link: http://lkml.kernel.org/r/20170615160002.17233-9-rgoldwyn@suse.de
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Chris Mason <clm@fb.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Cc: David Sterba <dsterba@suse.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Josef Bacik <jbacik@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/ext4/file.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff -puN fs/ext4/file.c~ext4-nowait-aio-support fs/ext4/file.c
--- a/fs/ext4/file.c~ext4-nowait-aio-support
+++ a/fs/ext4/file.c
@@ -216,7 +216,13 @@ ext4_file_write_iter(struct kiocb *iocb,
return ext4_dax_write_iter(iocb, from);
#endif
- inode_lock(inode);
+ if (iocb->ki_flags & IOCB_NOWAIT) {
+ if (!inode_trylock(inode))
+ return -EAGAIN;
+ } else {
+ inode_lock(inode);
+ }
+
ret = ext4_write_checks(iocb, from);
if (ret <= 0)
goto out;
@@ -235,9 +241,15 @@ ext4_file_write_iter(struct kiocb *iocb,
iocb->private = &overwrite;
/* Check whether we do a DIO overwrite or not */
- if (o_direct && ext4_should_dioread_nolock(inode) && !unaligned_aio &&
- ext4_overwrite_io(inode, iocb->ki_pos, iov_iter_count(from)))
- overwrite = 1;
+ if (o_direct && !unaligned_aio) {
+ if (ext4_overwrite_io(inode, iocb->ki_pos, iov_iter_count(from))) {
+ if (ext4_should_dioread_nolock(inode))
+ overwrite = 1;
+ } else if (iocb->ki_flags & IOCB_NOWAIT) {
+ ret = -EAGAIN;
+ goto out;
+ }
+ }
ret = __generic_file_write_iter(iocb, from);
inode_unlock(inode);
@@ -435,6 +447,10 @@ static int ext4_file_open(struct inode *
if (ret < 0)
return ret;
}
+
+ /* Set the flags to support nowait AIO */
+ filp->f_mode |= FMODE_NOWAIT_AIO;
+
return dquot_file_open(inode, filp);
}
_
Patches currently in -mm which might be from rgoldwyn@suse.com are
xfs-nowait-aio-support.patch
btrfs-nowait-aio-support.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-16 20:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-16 20:00 [to-be-updated] ext4-nowait-aio-support.patch removed from -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).