diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-07-21 17:16:09 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-07-21 17:16:09 -0300 |
commit | 4411a04f871d94ae997fb7262a428fe2ee988eb3 (patch) | |
tree | 92cb073311cb6c2eeb256969112ec61f877982d9 /fs/aufs/i_op.c | |
parent | b907a8622e39eecfc4b243f3be3ad26559d1faee (diff) |
Linux-libre 4.6.4-gnupck-4.6.4-gnu
Diffstat (limited to 'fs/aufs/i_op.c')
-rw-r--r-- | fs/aufs/i_op.c | 14 |
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; |