Re: [PATCH] dcache: error out if the name buffer is too short

2014-01-27 Thread Oleg Nesterov
On 01/26, Al Viro wrote: > > ... and already fixed. Said that, the point about restarts is definitely > true. See vfs.git#for-linus - it should propagate in a few Yes, http://git.kernel.org/cgit/linux/kernel/git/viro/vfs.git/commit/?h=for-linus&id=f6500801522c61782d4990fa1ad96154cb397cd4 should

Re: [PATCH] dcache: error out if the name buffer is too short

2014-01-26 Thread Al Viro
On Sun, Jan 26, 2014 at 05:35:36PM +0100, Oleg Nesterov wrote: > On 01/26, Oleg Nesterov wrote: > > > > Al, Denys, unless I am totally confused the "restart" logic is very broken. > > We can't simply restart because the main loop changes dentry? > > Plus prepend_name() can't actually return -ENAME

Re: [PATCH] dcache: error out if the name buffer is too short

2014-01-26 Thread Oleg Nesterov
On 01/26, Oleg Nesterov wrote: > > Al, Denys, unless I am totally confused the "restart" logic is very broken. > We can't simply restart because the main loop changes dentry? Plus prepend_name() can't actually return -ENAMETOOLONG, "int error" inside the loop is wrong. I believe the minimal fix i

Re: [PATCH] dcache: error out if the name buffer is too short

2014-01-26 Thread Oleg Nesterov
On 01/26, Oleg Nesterov wrote: > > 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(). And this motivated me to try to actually read __dentry_path(). Al, Denys, unless I am totally confused

Re: [PATCH] dcache: error out if the name buffer is too short

2014-01-26 Thread Oleg Nesterov
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, mos

Re: [PATCH] dcache: error out if the name buffer is too short

2014-01-24 Thread Oleg Nesterov
On 01/24, Denys Vlasenko wrote: > > This change makes __dentry_path() and d_path() > immediately return ENAMETOOLONG if buflen < 2. I am not sure about d_path, but as for __dentry_path: > @@ -3122,13 +3125,14 @@ static char *__dentry_path(struct dentry *dentry, > char *buf, int buflen) > i

[PATCH] dcache: error out if the name buffer is too short

2014-01-24 Thread Denys Vlasenko
This change makes __dentry_path() and d_path() immediately return ENAMETOOLONG if buflen < 2. Cc: Jan Kratochvil Cc: Oleg Nesterov Cc: linux-kernel@vger.kernel.org Signed-off-by: Denys Vlasenko --- fs/dcache.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/dcach