summaryrefslogtreecommitdiff
path: root/fs/aufs/i_op.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/aufs/i_op.c')
-rw-r--r--fs/aufs/i_op.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c
index ac3bf9437..c274958dd 100644
--- a/fs/aufs/i_op.c
+++ b/fs/aufs/i_op.c
@@ -184,8 +184,9 @@ static struct dentry *aufs_lookup(struct inode *dir, struct dentry *dentry,
if (!err)
err = au_digen_test(parent, au_sigen(sb));
if (!err) {
+ /* regardless LOOKUP_CREATE, always ALLOW_NEG */
npositive = au_lkup_dentry(dentry, au_dbtop(parent),
- /*type*/0);
+ AuLkup_ALLOW_NEG);
err = npositive;
}
di_read_unlock(parent, AuLock_IR);
@@ -266,6 +267,7 @@ static int aufs_atomic_open(struct inode *dir, struct dentry *dentry,
umode_t create_mode, int *opened)
{
int err, h_opened = *opened;
+ unsigned int lkup_flags;
struct dentry *parent;
struct dentry *d;
struct au_sphlhead *aopen;
@@ -279,14 +281,18 @@ static int aufs_atomic_open(struct inode *dir, struct dentry *dentry,
};
IMustLock(dir);
- AuDbg("open_flag 0x%x\n", open_flag);
+ AuDbg("open_flag 0%o\n", open_flag);
AuDbgDentry(dentry);
err = 0;
if (!au_di(dentry)) {
- d = aufs_lookup(dir, dentry, /*flags*/0);
+ lkup_flags = LOOKUP_OPEN;
+ if (open_flag & O_CREAT)
+ lkup_flags |= LOOKUP_CREATE;
+ d = aufs_lookup(dir, dentry, lkup_flags);
if (IS_ERR(d)) {
err = PTR_ERR(d);
+ AuTraceErr(err);
goto out;
} else if (d) {
/*
@@ -312,7 +318,7 @@ static int aufs_atomic_open(struct inode *dir, struct dentry *dentry,
parent = dentry->d_parent; /* dir is locked */
di_write_lock_parent(parent);
- err = au_lkup_dentry(dentry, /*btop*/0, /*type*/0);
+ err = au_lkup_dentry(dentry, /*btop*/0, AuLkup_ALLOW_NEG);
if (unlikely(err))
goto out_unlock;