summaryrefslogtreecommitdiffstats
path: root/fs/open.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 08:33:33 -0400
commit3d8a00d2099ebc6d5a6e95fadaf861709d9919a8 (patch)
tree317bfb9d71e3ef35746685c6da2397545917d81e /fs/open.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/open.c')
-rw-r--r--fs/open.c5
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,
786 int *opened) 786 int *opened)
787{ 787{
788 struct file *res; 788 struct file *res;
789 BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
789 790
790 mntget(od->mnt); 791 mntget(od->mnt);
791 dget(dentry); 792 dget(dentry);
792 793
793 res = do_dentry_open(dentry, od->mnt, od->filp, open, current_cred()); 794 res = do_dentry_open(dentry, od->mnt, od->filp, open, current_cred());
794 if (!IS_ERR(res)) { 795 if (!IS_ERR(res))
795 *opened |= FILE_OPENED; 796 *opened |= FILE_OPENED;
796 od->filp = NULL;
797 }
798 797
799 return res; 798 return res;
800} 799}