From: Oleg Nesterov <oleg@redhat.com>
To: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Jan Kratochvil <jan.kratochvil@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dcache: error out if the name buffer is too short
Date: Sun, 26 Jan 2014 16:37:37 +0100 [thread overview]
Message-ID: <20140126153737.GA8184@redhat.com> (raw)
In-Reply-To: <20140124161922.GA14195@redhat.com>
On 01/24, Oleg Nesterov wrote:
>
> And probably you are right, the fix should be as simple as possible.
> But can't we also simplify __dentry_path? Unless I missed something
> we can move prepend() up, before rcu_read_lock(), "move Get '/' right"
> into that prepend, and even kill retval... OK, most probably I missed
> something,
Of course I missed something ;)
> but at first glance we can do something like
>
> static char *__dentry_path(struct dentry *dentry, char *buf, int buflen)
> {
> int len, seq = 0;
> int error = 0;
> char *end;
>
> buf += buflen;
> /* Get '/' right, write "/\0" at the end */
> if (prepend(&buf, &buflen, "/", 2))
> goto Elong;
Heh. Not sure what I was thinking about, but this looks obviously wrong
when I re-read my email. This will add the extra "/" at the end, unless
IS_ROOT().
Sorry for noise.
Oleg.
next prev parent reply other threads:[~2014-01-26 15:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-24 14:04 [PATCH] dcache: error out if the name buffer is too short Denys Vlasenko
2014-01-24 16:19 ` Oleg Nesterov
2014-01-26 15:37 ` Oleg Nesterov [this message]
2014-01-26 15:51 ` Oleg Nesterov
2014-01-26 16:35 ` Oleg Nesterov
2014-01-26 17:41 ` Al Viro
2014-01-27 17:40 ` Oleg Nesterov
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=20140126153737.GA8184@redhat.com \
--to=oleg@redhat.com \
--cc=dvlasenk@redhat.com \
--cc=jan.kratochvil@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--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 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.