Re: [PATCH v2] aio: add timeout validity check for io_[p]getevents

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

 



On Tue, Jul 30, 2019 at 3:46 AM zhangyi (F) <yi.zhang@xxxxxxxxxx> wrote:

>  {
> -       ktime_t until = ts ? timespec64_to_ktime(*ts) : KTIME_MAX;
> -       struct kioctx *ioctx = lookup_ioctx(ctx_id);
> +       ktime_t until = KTIME_MAX;
> +       struct kioctx *ioctx = NULL;
>         long ret = -EINVAL;
>
> +       if (ts) {
> +               if (!timespec64_valid(ts))
> +                       return ret;
> +               until = timespec64_to_ktime(*ts);
> +       }

The man page should probably get updated as well to reflect that this
will now return -EINVAL for a negative timeout or malformed
nanoseconds.

      Arnd



[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