Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4919390ybi; Tue, 30 Jul 2019 10:26:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/ORSiKidYCZ41KeFwHGQr+D+lRsKQhwmeWjbDqpFUUoW8nXad/FuTZU7MQw8dM6ZFzX9c X-Received: by 2002:a17:90a:5887:: with SMTP id j7mr116716207pji.136.1564507562030; Tue, 30 Jul 2019 10:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564507562; cv=none; d=google.com; s=arc-20160816; b=O7ZbRcTItAqWP6PJc5PaPYMRE3I5eq958D4vZNkPKHTXCF7Ihm0MfAIbBzcJPk8Rza Kka3m0I4Y70O1jZgYwYqJs4diY/UQ2RLYLLKb9xmbbFzIueYKXs/vghJK6qOjFtvpJef mrncgnh77GG6w1WHOeW7jgb0YOaQjSWU8tgddbLPj6xdR6UfquZCu7xS2eAx6oHweed0 eBKC9adp1HYY0C2FyCSXWoo1GetjVhdzbP3FNeu0ynJqEllgT0Cu3oRmIFabTzsRnZo1 7g3espBTKuA0zFPELf5X2pDtPbhG1XjuCFu6G/i1l7c6p3Qo51cYiAzhT9cQxA/Qp2/V aGJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=ACLPuBe6mO+WmFXhtgYh4oXxQB/CtkfotsAiFdarZyM=; b=vD8heA+TOQGca4AqP+q98c5kcBHeB8kOGIoTGFXs/KxD0XO7rp/N4RUJwoH6r/mUdh r5yO+5umqMr3IvYeYxywqVBLBUP0SqnW/h7MKMLz88X9PViKW5i3YJmUBpFVQwT7Hvzx gFp4ksYiX+FXRweZQlSG7YSbJG7WvpNv5FqbJ8sZBCwsztshl89qoGgmfHN0xXhWZUq/ wacgNzsclZEB5z4bsY8+F1gki9SF7bzcW8rm/GTeiqzduyJzBBE2W8wgI+LOKCqbAApT cXa8H4/kIp+kdEeQHm+/Rgy3UFReWbNBSwoxRWjfOUdFchWkpTyUorMUUxEU/xwvXHVL p15w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u190si30390989pgd.547.2019.07.30.10.25.46; Tue, 30 Jul 2019 10:26:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727342AbfG3NwT (ORCPT + 99 others); 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.