Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
a9d1958b4b
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  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;
 	mode |= HOSTFS_I(ino)->mode;
 
 
 retry:
 retry:
+	r = w = 0;
+
 	if (mode & FMODE_READ)
 	if (mode & FMODE_READ)
 		r = 1;
 		r = 1;
 	if (mode & FMODE_WRITE)
 	if (mode & FMODE_WRITE)