diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-10 11:04:43 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 14:33:33 +0200 |
commit | 3d8a00d2099ebc6d5a6e95fadaf861709d9919a8 (patch) | |
tree | 317bfb9d71e3ef35746685c6da2397545917d81e /fs/open.c | |
parent | ->atomic_open() prototype change - pass int * instead of bool * (diff) | |
download | linux-3d8a00d2099ebc6d5a6e95fadaf861709d9919a8.tar.xz linux-3d8a00d2099ebc6d5a6e95fadaf861709d9919a8.zip |
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 '')
-rw-r--r-- | fs/open.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/open.c b/fs/open.c index 89589bd3993c..c87f98201c29 100644 --- a/fs/open.c +++ b/fs/open.c @@ -786,15 +786,14 @@ struct file *finish_open(struct opendata *od, struct dentry *dentry, int *opened) { struct file *res; + BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */ mntget(od->mnt); dget(dentry); res = do_dentry_open(dentry, od->mnt, od->filp, open, current_cred()); - if (!IS_ERR(res)) { + if (!IS_ERR(res)) *opened |= FILE_OPENED; - od->filp = NULL; - } return res; } |