From: Matthew Wilcox <willy@infradead.org>
To: aloktiagi <aloktiagi@gmail.com>
Cc: viro@zeniv.linux.org.uk, brauner@kernel.org,
David.Laight@aculab.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, keescook@chromium.org,
hch@infradead.org, tycho@tycho.pizza
Subject: Re: [RFC v6 1/2] epoll: Implement eventpoll_replace_file()
Date: Tue, 23 May 2023 14:31:58 +0100 [thread overview]
Message-ID: <ZGzATlGu7mh6EFUi@casper.infradead.org> (raw)
In-Reply-To: <20230523065802.2253926-1-aloktiagi@gmail.com>
On Tue, May 23, 2023 at 06:58:01AM +0000, aloktiagi wrote:
> +/*
> + * This is called from eventpoll_replace() to replace a linked file in the epoll
> + * interface with a new file received from another process. This is useful in
> + * cases where a process is trying to install a new file for an existing one
> + * that is linked in the epoll interface
> + */
> +int eventpoll_replace_file(struct file *toreplace, struct file *file, int tfd)
Functions do not control where they are called from. Just take that
clause out:
/*
* Replace a linked file in the epoll interface with a new file received
* from another process. This allows a process to
* install a new file for an existing one that is linked in the epoll
* interface
*/
But, erm, aren't those two sentences basically saying the same thing?
So simplify again:
/*
* Replace a linked file in the epoll interface with a new file
*/
> diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
> index 3337745d81bd..2a6c8f52f272 100644
> --- a/include/linux/eventpoll.h
> +++ b/include/linux/eventpoll.h
> @@ -25,6 +25,14 @@ struct file *get_epoll_tfile_raw_ptr(struct file *file, int tfd, unsigned long t
> /* Used to release the epoll bits inside the "struct file" */
> void eventpoll_release_file(struct file *file);
>
> +/*
> + * This is called from fs/file.c:do_replace() to replace a linked file in the
> + * epoll interface with a new file received from another process. This is useful
> + * in cases where a process is trying to install a new file for an existing one
> + * that is linked in the epoll interface
> + */
> +int eventpoll_replace_file(struct file *toreplace, struct file *file, int tfd);
No need to repeat the comment again. Just delete it here.
next prev parent reply other threads:[~2023-05-23 13:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-23 6:58 [RFC v6 1/2] epoll: Implement eventpoll_replace_file() aloktiagi
2023-05-23 6:58 ` [RFC v6 2/2] seccomp: replace existing file in the epoll interface by a new file injected by the syscall supervisor aloktiagi
2023-05-23 12:32 ` [RFC v6 1/2] epoll: Implement eventpoll_replace_file() Christian Brauner
2023-05-24 6:36 ` Alok Tiagi
2023-05-23 13:31 ` Matthew Wilcox [this message]
2023-05-24 6:37 ` Alok Tiagi
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=ZGzATlGu7mh6EFUi@casper.infradead.org \
--to=willy@infradead.org \
--cc=David.Laight@aculab.com \
--cc=aloktiagi@gmail.com \
--cc=brauner@kernel.org \
--cc=hch@infradead.org \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tycho@tycho.pizza \
--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;
as well as URLs for NNTP newsgroup(s).