From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Kent Subject: [PATCH 1/5] autofs4 - fix symlink name allocation Date: Tue, 01 Jul 2008 17:25:50 +0800 Message-ID: <20080701092548.12041.69868.stgit@raven.themaw.net> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: autofs mailing list , linux-fsdevel , Kernel Mailing List To: Andrew Morton Return-path: Received: from outbound.icp-qv1-irony-out4.iinet.net.au ([203.59.1.150]:58646 "EHLO outbound.icp-qv1-irony-out4.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753493AbYGAJ2t (ORCPT ); Tue, 1 Jul 2008 05:28:49 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- fs/autofs4/root.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 7f3ebf1..10add99 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c @@ -774,6 +774,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) @@ -805,7 +806,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;