Re: [PATCH] readv.2: Fix wrong errno for an unknown flag

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

 



Hi,

Ping.  :-) 

Best Regards,
Xiao Yang
On 2018/10/05 10:50, Xiao Yang wrote:

> According to the following kernel code, preadv2(2)/pwritev2(2) with
> an unknown flag actually returned EOPNOTSUPP instead of EINVAL:
> ----------------------------------------------------------------
> static inline int kiocb_set_rw_flags(struct kiocb *ki, rwf_t flags)
> {
> 	if (unlikely(flags & ~RWF_SUPPORTED)) {
> 		return -EOPNOTSUPP;
> 	}
> 	...
> }
>
> static ssize_t do_loop_readv_writev(struct file *filp, struct iov_iter *iter,
> 		loff_t *ppos, int type, rwf_t flags)
> {
> 	...
> 	if (flags & ~RWF_HIPRI)
> 		return -EOPNOTSUPP;
> 	...
> }
>
> Signed-off-by: Xiao Yang <yangx.jy@xxxxxxxxxxxxxx>
> ---
>  man2/readv.2 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/man2/readv.2 b/man2/readv.2
> index 4441e92..2d73007 100644
> --- a/man2/readv.2
> +++ b/man2/readv.2
> @@ -312,7 +312,7 @@ The vector count,
>  .IR iovcnt ,
>  is less than zero or greater than the permitted maximum.
>  .TP
> -.B EINVAL
> +.B EOPNOTSUPP
>  An unknown flag is specified in \fIflags\fP.
>  .SH VERSIONS
>  .BR preadv ()






[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux