OSDN Git Service

vfs: don't evict uninitialized inode
[android-x86/kernel.git] / fs / dcache.c
index ceb7b49..baa89f0 100644 (file)
@@ -292,7 +292,8 @@ void take_dentry_name_snapshot(struct name_snapshot *name, struct dentry *dentry
                spin_unlock(&dentry->d_lock);
                name->name = p->name;
        } else {
-               memcpy(name->inline_name, dentry->d_iname, DNAME_INLINE_LEN);
+               memcpy(name->inline_name, dentry->d_iname,
+                      dentry->d_name.len + 1);
                spin_unlock(&dentry->d_lock);
                name->name = name->inline_name;
        }
@@ -1889,7 +1890,7 @@ void d_instantiate_new(struct dentry *entry, struct inode *inode)
        spin_lock(&inode->i_lock);
        __d_instantiate(entry, inode);
        WARN_ON(!(inode->i_state & I_NEW));
-       inode->i_state &= ~I_NEW;
+       inode->i_state &= ~I_NEW & ~I_CREATING;
        smp_mb();
        wake_up_bit(&inode->i_state, __I_NEW);
        spin_unlock(&inode->i_lock);