From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC5E8C433FF for ; Tue, 30 Jul 2019 13:52:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91304206E0 for ; Tue, 30 Jul 2019 13:52:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728056AbfG3NwT (ORCPT ); Tue, 30 Jul 2019 09:52:19 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:35970 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725871AbfG3NwT (ORCPT ); Tue, 30 Jul 2019 09:52:19 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id EC710200DE7754C3E6FA; Tue, 30 Jul 2019 21:52:16 +0800 (CST) Received: from [127.0.0.1] (10.177.244.145) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Tue, 30 Jul 2019 21:52:08 +0800 Subject: Re: [PATCH v2] aio: add timeout validity check for io_[p]getevents To: Arnd Bergmann References: <1564451504-27906-1-git-send-email-yi.zhang@huawei.com> CC: linux-aio , Linux FS-devel Mailing List , Linux Kernel Mailing List , Benjamin LaHaise , Al Viro , Jeff Moyer , Deepa Dinamani , Kefeng Wang From: "zhangyi (F)" Message-ID: Date: Tue, 30 Jul 2019 21:52:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.244.145] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/7/30 15:11, Arnd Bergmann Wrote: > On Tue, Jul 30, 2019 at 3:46 AM zhangyi (F) 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. > Thanks for your suggestion, I will add a patch to update the man page. Thanks, Yi.