From: Alexey Dobriyan <adobriyan@gmail.com>
To: Hao Lee <haolee.swjtu@gmail.com>
Cc: akpm@linux-foundation.org, christian.brauner@ubuntu.com,
keescook@chromium.org, jamorris@linux.microsoft.com,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc: use kmalloc instead of __get_free_page() to alloc path buffer
Date: Sun, 23 Jan 2022 16:55:51 +0300 [thread overview]
Message-ID: <Ye1eZ5rl2E/jy8Tk@localhost.localdomain> (raw)
In-Reply-To: <20220123100837.GA1491@haolee.io>
On Sun, Jan 23, 2022 at 10:08:37AM +0000, Hao Lee wrote:
> It's not a standard approach that use __get_free_page() to alloc path
> buffer directly. We'd better use kmalloc and PATH_MAX.
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -1764,25 +1764,26 @@ static const char *proc_pid_get_link(struct dentry *dentry,
>
> static int do_proc_readlink(struct path *path, char __user *buffer, int buflen)
> {
> - char *tmp = (char *)__get_free_page(GFP_KERNEL);
> + char *buf = NULL;
I'd rather not rename anything but keep it minimal.
next prev parent reply other threads:[~2022-01-23 13:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-23 10:08 [PATCH] proc: use kmalloc instead of __get_free_page() to alloc path buffer Hao Lee
2022-01-23 13:55 ` Alexey Dobriyan [this message]
2022-01-23 13:58 ` [PATCH v2] proc: alloc PATH_MAX bytes for /proc/${pid}/fd/ symlinks Alexey Dobriyan
2022-01-23 14:23 ` Hao Lee
2022-01-25 14:03 ` [PATCH] proc: use kmalloc instead of __get_free_page() to alloc path buffer Torin Carey
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=Ye1eZ5rl2E/jy8Tk@localhost.localdomain \
--to=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=christian.brauner@ubuntu.com \
--cc=haolee.swjtu@gmail.com \
--cc=jamorris@linux.microsoft.com \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.