[PATCH 01/10] fs: Separate out kiocb flags setup based on RWF_* flags

2017-06-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Signed-off-by: Goldwyn Rodrigues --- fs/read_write.c| 12 +++- include/linux/fs.h | 14 ++ 2 files changed, 17 insertions(+),

[PATCH 02/10] fs: Introduce filemap_range_has_page()

2017-06-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues filemap_range_has_page() return true if the file's mapping has a page within the range mentioned. This function will be used to check if a write() call will cause a writeback of previous writes. Reviewed-by: Christoph Hellwig Reviewed-by:

[PATCH 06/10] fs: Introduce IOMAP_NOWAIT

2017-06-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues IOCB_NOWAIT translates to IOMAP_NOWAIT for iomaps. This is used by XFS in the XFS patch. Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Signed-off-by: Goldwyn Rodrigues --- fs/iomap.c|

[PATCH 09/10] xfs: nowait aio support

2017-06-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues If IOCB_NOWAIT is set, bail if the i_rwsem is not lockable immediately. IF IOMAP_NOWAIT is set, return EAGAIN in xfs_file_iomap_begin if it needs allocation either due to file extension, writing to a hole, or COW or waiting for other DIOs to finish.

[PATCH 08/10] ext4: nowait aio support

2017-06-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues 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 Signed-off-by: Goldwyn Rodrigues

[PATCH 10/10] btrfs: nowait aio support

2017-06-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Return EAGAIN if any of the following checks fail + i_rwsem is not lockable + NODATACOW or PREALLOC is not set + Cannot nocow at the desired location + Writing beyond end of file which is not allocated Acked-by: David Sterba

[PATCH 03/10] fs: Use RWF_* flags for AIO operations

2017-06-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues aio_rw_flags is introduced in struct iocb (using aio_reserved1) which will carry the RWF_* flags. We cannot use aio_flags because they are not checked for validity which may break existing applications. Note, the only place RWF_HIPRI comes in effect is

[PATCH 05/10] fs: return if direct write will trigger writeback

2017-06-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Find out if the write will trigger a wait due to writeback. If yes, return -EAGAIN. Return -EINVAL for buffered AIO: there are multiple causes of delay such as page locks, dirty throttling logic, page loading from disk etc. which cannot be taken care

[PATCH 04/10] fs: Introduce RWF_NOWAIT

2017-06-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues RWF_NOWAIT informs kernel to bail out if an AIO request will block for reasons such as file allocations, or a writeback triggered, or would block while allocating requests while performing direct I/O. RWF_NOWAIT is translated to IOCB_NOWAIT for

[PATCH 07/10] fs: return on congested block device

2017-06-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues A new bio operation flag REQ_NOWAIT is introduced to identify bio's orignating from iocb with IOCB_NOWAIT. This flag indicates to return immediately if a request cannot be made instead of retrying. Stacked devices such as md (the ones with

[PATCH 0/10 v10] No wait AIO

2017-06-04 Thread Goldwyn Rodrigues
Formerly known as non-blocking AIO. This series adds nonblocking feature to asynchronous I/O writes. io_submit() can be delayed because of a number of reason: - Block allocation for files - Data writebacks for direct I/O - Sleeping because of waiting to acquire i_rwsem - Congested block

[BUG] direct I/O pwrite() returning EEXIST on btrfs

2017-06-04 Thread Eric Biggers
Hi, For at least a few kernel versions now I've been receiving I/O errors in a KVM guest when testing ext4 with kvm-xfstests on a particular computer. I've tracked this down to the host filesystem which is BTRFS, and is sometimes returning EEXIST to pwrite() calls made by QEMU to write to the

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-04 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 10:18 PM, Arnd Bergmann wrote: > On Fri, Jun 2, 2017 at 2:18 PM, Yan, Zheng wrote: >> On Fri, Jun 2, 2017 at 7:33 PM, Arnd Bergmann wrote: >>> On Fri, Jun 2, 2017 at 1:18 PM, Yan, Zheng wrote: >>> What I