From: Ian Kent Date: Thu, 24 Jul 2008 04:30:13 +0000 (-0700) Subject: autofs4: fix symlink name allocation X-Git-Tag: v2.6.27-rc1~639 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=ef581a742874ebc4c28d24b374c78b762144ebdc;p=linux-2.6-omap-h63xx.git autofs4: fix symlink name allocation The length of the symlink name has been moved but it needs to be set before allocating space for it in the dentry info struct. This corrects a mistake in a recent patch. Signed-off-by: Ian Kent Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index dbb70d5a488..324290c6827 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c @@ -775,6 +775,7 @@ static int autofs4_dir_symlink(struct inode *dir, list_del_init(&ino->active); spin_unlock(&sbi->lookup_lock); + ino->size = strlen(symname); cp = kmalloc(ino->size + 1, GFP_KERNEL); if (!cp) { if (!dentry->d_fsdata) @@ -806,7 +807,6 @@ static int autofs4_dir_symlink(struct inode *dir, atomic_inc(&p_ino->count); ino->inode = inode; - ino->size = strlen(symname); ino->u.symlink = cp; dir->i_mtime = CURRENT_TIME;