From: Richard Weinberger Date: Wed, 4 Mar 2015 21:39:48 +0000 (+0100) Subject: hostfs: hostfs_open: Reset open flags upon each retry X-Git-Tag: v4.14-rc1~5585^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9d1958b4b9a688becceda44938baac99a62fbd7;p=platform%2Fkernel%2Flinux-rpi.git hostfs: hostfs_open: Reset open flags upon each retry ...otherwise we might end up with an incorrect mode mode. Signed-off-by: Richard Weinberger --- diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 8bbceae..80ced3d 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)