瀏覽代碼

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>
Richard Weinberger 10 年之前
父節點
當前提交
a9d1958b4b
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fs/hostfs/hostfs_kern.c

+ 2 - 0
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)