Re: [PATCH 7/7] check for O_NONBLOCK in all read_iter instances

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christoph Hellwig <milosz@xxxxxxxxx> writes:

Hrm, you're not Christoph...

> Acked-by: Milosz Tanski <milosz@xxxxxxxxx>
> ---
>  fs/ceph/file.c    |    2 ++
>  fs/cifs/file.c    |    6 ++++++
>  fs/nfs/file.c     |    5 ++++-
>  fs/ocfs2/file.c   |    6 ++++++
>  fs/pipe.c         |    3 ++-
>  fs/read_write.c   |   17 +++++++++++------
>  fs/xfs/xfs_file.c |    4 ++++
>  mm/shmem.c        |    4 ++++
>  8 files changed, 39 insertions(+), 8 deletions(-)
>
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index 4776257..b62e3a5 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -808,6 +808,8 @@ again:
>  	if ((got & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) == 0 ||
>  	    (iocb->ki_filp->f_flags & O_DIRECT) ||
>  	    (fi->flags & CEPH_F_SYNC)) {
> +		if (flags & O_NONBLOCK)
> +			return -EAGAIN;

Again, the right return value for the O_DIRECT case is EINVAL.

> diff --git a/fs/nfs/file.c b/fs/nfs/file.c
> index 4072f3a..116bed2 100644
> --- a/fs/nfs/file.c
> +++ b/fs/nfs/file.c
> @@ -170,8 +170,11 @@ nfs_file_read(struct kiocb *iocb, struct iov_iter *to, int flags)
>  	struct inode *inode = file_inode(iocb->ki_filp);
>  	ssize_t result;
>  
> -	if (iocb->ki_filp->f_flags & O_DIRECT)
> +	if (iocb->ki_filp->f_flags & O_DIRECT) {
> +		if (flags & O_NONBLOCK)
> +			return -EAGAIN;
>  		return nfs_file_direct_read(iocb, to, iocb->ki_pos, true);
> +	}

And here.  I stopped looking for that case at this point.

Cheers,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux