lkml.org 
[lkml]   [2014]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dcache: error out if the name buffer is too short
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.



\
 
 \ /
  Last update: 2014-01-26 17:21    [W:0.141 / U:0.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site