[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdWgjrYVoMyLHWa6YUhrEpQ9uk6rWj30i=4sxGxXaV4zNQ@mail.gmail.com>
Date: Mon, 10 Feb 2025 09:21:23 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Mateusz Guzik <mjguzik@...il.com>
Cc: brauner@...nel.org, viro@...iv.linux.org.uk, jack@...e.cz,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v3 3/3] vfs: use the new debug macros in inode_set_cached_link()
Hi Mateusz,
On Sat, 8 Feb 2025 at 17:27, Mateusz Guzik <mjguzik@...il.com> wrote:
> Signed-off-by: Mateusz Guzik <mjguzik@...il.com>
Thanks for your patch!
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -792,19 +792,8 @@ struct inode {
>
> static inline void inode_set_cached_link(struct inode *inode, char *link, int linklen)
> {
> - int testlen;
> -
> - /*
> - * TODO: patch it into a debug-only check if relevant macros show up.
> - * In the meantime, since we are suffering strlen even on production kernels
> - * to find the right length, do a fixup if the wrong value got passed.
> - */
> - testlen = strlen(link);
> - if (testlen != linklen) {
> - WARN_ONCE(1, "bad length passed for symlink [%s] (got %d, expected %d)",
> - link, linklen, testlen);
> - linklen = testlen;
This is a (undocumented) change in behavior.
> - }
> + VFS_WARN_ON_INODE(strlen(link) != linklen, inode);
This change matches the one-line patch summary.
> + VFS_WARN_ON_INODE(inode->i_opflags & IOP_CACHED_LINK, inode);
This (unrelated?) change is not described in the patch description.
> inode->i_link = link;
> inode->i_linklen = linklen;
> inode->i_opflags |= IOP_CACHED_LINK;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists