提交 ef581a74 编写于 作者: I Ian Kent 提交者: Linus Torvalds

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: NIan Kent <raven@themaw.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 25767378
...@@ -775,6 +775,7 @@ static int autofs4_dir_symlink(struct inode *dir, ...@@ -775,6 +775,7 @@ static int autofs4_dir_symlink(struct inode *dir,
list_del_init(&ino->active); list_del_init(&ino->active);
spin_unlock(&sbi->lookup_lock); spin_unlock(&sbi->lookup_lock);
ino->size = strlen(symname);
cp = kmalloc(ino->size + 1, GFP_KERNEL); cp = kmalloc(ino->size + 1, GFP_KERNEL);
if (!cp) { if (!cp) {
if (!dentry->d_fsdata) if (!dentry->d_fsdata)
...@@ -806,7 +807,6 @@ static int autofs4_dir_symlink(struct inode *dir, ...@@ -806,7 +807,6 @@ static int autofs4_dir_symlink(struct inode *dir,
atomic_inc(&p_ino->count); atomic_inc(&p_ino->count);
ino->inode = inode; ino->inode = inode;
ino->size = strlen(symname);
ino->u.symlink = cp; ino->u.symlink = cp;
dir->i_mtime = CURRENT_TIME; dir->i_mtime = CURRENT_TIME;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册