diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-10 05:04:43 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 08:33:33 -0400 |
commit | 3d8a00d2099ebc6d5a6e95fadaf861709d9919a8 (patch) | |
tree | 317bfb9d71e3ef35746685c6da2397545917d81e /fs/open.c | |
parent | 47237687d73cbeae1dd7a133c3fc3d7239094568 (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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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 | } |