summaryrefslogtreecommitdiffstats
path: root/fs/hostfs
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2015-03-04 22:39:48 +0100
committerRichard Weinberger <richard@nod.at>2015-03-26 23:27:52 +0100
commita9d1958b4b9a688becceda44938baac99a62fbd7 (patch)
tree33cfa12dcf5033b16ad5c5cf92ee9ad855a2fa7c /fs/hostfs
parent112a5da717f86250bc6be2c63e7af174be7c5507 (diff)
downloadlinux-stable-a9d1958b4b9a688becceda44938baac99a62fbd7.tar.gz
linux-stable-a9d1958b4b9a688becceda44938baac99a62fbd7.tar.bz2
linux-stable-a9d1958b4b9a688becceda44938baac99a62fbd7.zip
hostfs: hostfs_open: Reset open flags upon each retry
...otherwise we might end up with an incorrect mode mode. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/hostfs')
-rw-r--r--fs/hostfs/hostfs_kern.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 8bbceae5ed03..80ced3dc84ae 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -315,6 +315,8 @@ static int hostfs_open(struct inode *ino, struct file *file)
mode |= HOSTFS_I(ino)->mode;
retry:
+ r = w = 0;
+
if (mode & FMODE_READ)
r = 1;
if (mode & FMODE_WRITE)