Skip to content

Commit

Permalink
autofs4: fix symlink name allocation
Browse files Browse the repository at this point in the history
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 <raven@themaw.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ian Kent authored and Linus Torvalds committed Jul 24, 2008
1 parent 2576737 commit ef581a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/autofs4/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit ef581a7

Please sign in to comment.