public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Naresh Kamboju <naresh.kamboju@linaro.org>,
	open list <linux-kernel@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org, regressions@lists.linux.dev,
	lkft-triage@lists.linaro.org,
	Linux-Next Mailing List <linux-next@vger.kernel.org>,
	LTP List <ltp@lists.linux.it>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Anders Roxell <anders.roxell@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>, chrubis <chrubis@suse.cz>
Subject: Re: next: LTP: syscalls: epoll_clt() if fd is an invalid fd expected EBADF: EINVAL (22)
Date: Wed, 7 Dec 2022 09:22:45 -0700	[thread overview]
Message-ID: <b7d8193c-7e15-f5cd-08d4-8ef788d9bb36@kernel.dk> (raw)
In-Reply-To: <CA+G9fYv_UU+oVUbd8Mzt8FkXscenX2kikRSCZ7DPXif9i5erNg@mail.gmail.com>

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

  reply	other threads:[~2022-12-07 16:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 15:58 next: LTP: syscalls: epoll_clt() if fd is an invalid fd expected EBADF: EINVAL (22) Naresh Kamboju
2022-12-07 16:22 ` Jens Axboe [this message]
2022-12-07 22:27   ` Anders Roxell
2022-12-08  1:36     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7d8193c-7e15-f5cd-08d4-8ef788d9bb36@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=anders.roxell@linaro.org \
    --cc=arnd@arndb.de \
    --cc=chrubis@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=ltp@lists.linux.it \
    --cc=naresh.kamboju@linaro.org \
    --cc=regressions@lists.linux.dev \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox