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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4423C63703 for ; Wed, 7 Dec 2022 16:22:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229653AbiLGQW4 (ORCPT ); Wed, 7 Dec 2022 11:22:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbiLGQWv (ORCPT ); Wed, 7 Dec 2022 11:22:51 -0500 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF3C025C7A for ; Wed, 7 Dec 2022 08:22:47 -0800 (PST) Received: by mail-io1-xd2d.google.com with SMTP id n188so12065425iof.8 for ; Wed, 07 Dec 2022 08:22:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Bn9I9xV79fJUCgoxsa3ub+uGmmlj3Tv0J26ZcN9So2c=; b=oktSzxAShr3BHoD72bP4RFPVPK2PQ9754FcMwUZLSN4JtDJnGYSSmZWOGHv94kk8p2 hRwss1tlAVG7p8Av2GnMo81SayC6jYcGxuvgfQjOmrGY3anuIuUmHTnrOwK4bjFlrHLH 8X2zXyi3q6BymHi1hN9CxD5+hoxVUb4cv+kVB+LerzeBetWY4WfSZ5+f327qAreMbIrn 68t4pMOeqqBpF9HLmnL9+4GnvtxCjB6tGckAQYSJQEdBSt77fS7PfaRqOq6S74eXp1OI HyGz4pZzTJh8yNYLubKPUaRkK+fiekioy/q9ElL9E6hHGOMvjaC1n0ZrZ+A9RVFAaNNK rmtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Bn9I9xV79fJUCgoxsa3ub+uGmmlj3Tv0J26ZcN9So2c=; b=g94zhfWQRLBd/sGA5OP7A9o5zpLs0fSyXdG0rIZk1pXzRetQtp64wrxCq/hOk3kBqB J2clymFNKO3fApMpQy26TCeSPzLlPpn3Mk345rkjzwoiHBUyF7P/1E2XXa9MVo8ChMur yMlwCHgM9Tca7EHcFS6SaXpKrFSs0jWPQQmGfHIDichzSKhrUOJLgiAPjNrqaTSzmWfc jVzQxIdVO5+TOvv60+9wJ1FzyizQ/1Wdw7aX8M+G3FOp0psQWscBwCYALinW4vax7dIZ jwn57sHLdgARW2aVI7mGP24dA+SdxQX22WZSjZMjSgRXLzhooM1RofWpzvCqpPhBG3Ia a13A== X-Gm-Message-State: ANoB5plwVDQGU9MJ4cuM17bgUmAn34SZ4KXljPJDuaxvb1ndojP/2y4e svRGZDZdAFLYk6Z1sw3cCwh66Q== X-Google-Smtp-Source: AA0mqf4ybGl8vC1UVIEO3y/JfQbgJP/6fnnH7vd2PgBXxTLGzha4ra0sC3Q2OFIDuj9XNhFK1cMt4Q== X-Received: by 2002:a02:334d:0:b0:376:22fe:5e7c with SMTP id k13-20020a02334d000000b0037622fe5e7cmr43131407jak.126.1670430167275; Wed, 07 Dec 2022 08:22:47 -0800 (PST) Received: from [192.168.1.94] ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id p12-20020a056e0206cc00b00302f958e71dsm7202366ils.49.2022.12.07.08.22.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Dec 2022 08:22:46 -0800 (PST) Message-ID: Date: Wed, 7 Dec 2022 09:22:45 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: next: LTP: syscalls: epoll_clt() if fd is an invalid fd expected EBADF: EINVAL (22) Content-Language: en-US To: Naresh Kamboju , open list , linux-fsdevel@vger.kernel.org, regressions@lists.linux.dev, lkft-triage@lists.linaro.org, Linux-Next Mailing List , LTP List Cc: Alexander Viro , Anders Roxell , Arnd Bergmann , chrubis References: From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/7/22 8:58?AM, Naresh Kamboju wrote: > LTP syscalls epoll_ctl02 is failing on Linux next master. > The reported problem is always reproducible and starts from next-20221205. > > GOOD tag: next-20221202 > BAD tag: next-20221205 > > tst_test.c:1524: TINFO: Timeout per run is 0h 05m 00s > epoll_ctl02.c:87: TPASS: epoll_clt(...) if epfd is an invalid fd : EBADF (9) > epoll_ctl02.c:87: TPASS: epoll_clt(...) if fd does not support epoll : EPERM (1) > epoll_ctl02.c:87: TFAIL: epoll_clt(...) if fd is an invalid fd > expected EBADF: EINVAL (22) > epoll_ctl02.c:87: TPASS: epoll_clt(...) if op is not supported : EINVAL (22) > epoll_ctl02.c:87: TPASS: epoll_clt(...) if fd is the same as epfd : EINVAL (22) > epoll_ctl02.c:87: TPASS: epoll_clt(...) if events is NULL : EFAULT (14) > epoll_ctl02.c:87: TPASS: epoll_clt(...) if fd is not registered with > EPOLL_CTL_DEL : ENOENT (2) > epoll_ctl02.c:87: TPASS: epoll_clt(...) if fd is not registered with > EPOLL_CTL_MOD : ENOENT (2) > epoll_ctl02.c:87: TPASS: epoll_clt(...) if fd is already registered > with EPOLL_CTL_ADD : EEXIST (17) This should fix it: diff --git a/fs/eventpoll.c b/fs/eventpoll.c index ec7ffce8265a..de9c551e1993 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -2195,6 +2195,7 @@ int do_epoll_ctl(int epfd, int op, int fd, struct epoll_event *epds, } /* Get the "struct file *" for the target file */ + error = -EBADF; tf = fdget(fd); if (!tf.file) goto error_fput; -- Jens Axboe