summaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-10 05:04:43 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 16:33:33 +0400
commit3d8a00d2099ebc6d5a6e95fadaf861709d9919a8 (patch)
tree317bfb9d71e3ef35746685c6da2397545917d81e /fs/namei.c
parent47237687d73cbeae1dd7a133c3fc3d7239094568 (diff)
don't modify od->filp at all
make put_filp() conditional on flag set by finish_open() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 7a33f074e5bd..18b9326d951f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2708,10 +2708,8 @@ out:
path_put(&nd->root);
if (base)
fput(base);
- if (od.filp) {
- BUG_ON(od.filp->f_path.dentry);
+ if (!(opened & FILE_OPENED))
put_filp(od.filp);
- }
if (res == ERR_PTR(-EOPENSTALE)) {
if (flags & LOOKUP_RCU)
res = ERR_PTR(-ECHILD);