From f1a0744b8949dd13cf5e00ae259e5a93546448c1 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 16 Jan 2011 18:29:35 -0500 Subject: [PATCH] --- yaml --- r: 231790 b: refs/heads/master c: 5a37db302e698a83209eff22ca8f3fd05eb1d84b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/autofs4/root.c | 28 ++++++++++------------------ 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/[refs] b/[refs] index 39116b216796..00d739a730c6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 726a5e0688fd344110d8f2979d87f243a4ba1a48 +refs/heads/master: 5a37db302e698a83209eff22ca8f3fd05eb1d84b diff --git a/trunk/fs/autofs4/root.c b/trunk/fs/autofs4/root.c index 83e5379c5ade..a5b93e8f49b5 100644 --- a/trunk/fs/autofs4/root.c +++ b/trunk/fs/autofs4/root.c @@ -539,18 +539,15 @@ static int autofs4_dir_symlink(struct inode *dir, if (!autofs4_oz_mode(sbi)) return -EACCES; - ino = autofs4_init_ino(ino, sbi); - if (!ino) - return -ENOMEM; + BUG_ON(!ino); + + autofs4_init_ino(ino, sbi); autofs4_del_active(dentry); cp = kmalloc(size + 1, GFP_KERNEL); - if (!cp) { - if (!dentry->d_fsdata) - kfree(ino); + if (!cp) return -ENOMEM; - } strcpy(cp, symname); @@ -565,8 +562,7 @@ static int autofs4_dir_symlink(struct inode *dir, inode->i_size = size; d_add(dentry, inode); - dentry->d_fsdata = ino; - ino->dentry = dget(dentry); + dget(dentry); atomic_inc(&ino->count); p_ino = autofs4_dentry_ino(dentry->d_parent); if (p_ino && dentry->d_parent != dentry) @@ -734,25 +730,21 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode) DPRINTK("dentry %p, creating %.*s", dentry, dentry->d_name.len, dentry->d_name.name); - ino = autofs4_init_ino(ino, sbi); - if (!ino) - return -ENOMEM; + BUG_ON(!ino); + + autofs4_init_ino(ino, sbi); autofs4_del_active(dentry); inode = autofs4_get_inode(dir->i_sb, S_IFDIR | 0555); - if (!inode) { - if (!dentry->d_fsdata) - kfree(ino); + if (!inode) return -ENOMEM; - } d_add(dentry, inode); if (sbi->version < 5) autofs_set_leaf_automount_flags(dentry); - dentry->d_fsdata = ino; - ino->dentry = dget(dentry); + dget(dentry); atomic_inc(&ino->count); p_ino = autofs4_dentry_ino(dentry->d_parent); if (p_ino && dentry->d_parent != dentry)