From a9d1958b4b9a688becceda44938baac99a62fbd7 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Wed, 4 Mar 2015 22:39:48 +0100 Subject: hostfs: hostfs_open: Reset open flags upon each retry ...otherwise we might end up with an incorrect mode mode. Signed-off-by: Richard Weinberger --- fs/hostfs/hostfs_kern.c | 2 ++ 1 file changed, 2 insertions(+) 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) -- cgit v1.2.1