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>
This commit is contained in:
Al Viro
2012-06-10 05:04:43 -04:00
parent 47237687d7
commit 3d8a00d209
2 changed files with 3 additions and 6 deletions

View File

@@ -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);