1

fs/9p: Fix bit operation logic error

This re-introduces a fix that somehow got dropped during rebase of the
current series in for-next.  When writeback is enabled, opens
are forced to support both read and write operations but with the
logic error other flags may be dropped unintentionaly.

Reported-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
This commit is contained in:
Eric Van Hensbergen 2023-04-26 16:18:49 +00:00
parent 4eb3117888
commit 21e26d5e54
No known key found for this signature in database
GPG Key ID: 88FFD5FB4A5FFF98
2 changed files with 2 additions and 2 deletions

View File

@ -823,7 +823,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
p9_omode = v9fs_uflags2omode(flags, v9fs_proto_dotu(v9ses));
if ((v9ses->cache & CACHE_WRITEBACK) && (p9_omode & P9_OWRITE)) {
p9_omode = (p9_omode & !P9_OWRITE) | P9_ORDWR;
p9_omode = (p9_omode & ~P9_OWRITE) | P9_ORDWR;
p9_debug(P9_DEBUG_CACHE,
"write-only file with writeback enabled, creating w/ O_RDWR\n");
}

View File

@ -288,7 +288,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
}
if ((v9ses->cache & CACHE_WRITEBACK) && (p9_omode & P9_OWRITE)) {
p9_omode = (p9_omode & !P9_OWRITE) | P9_ORDWR;
p9_omode = (p9_omode & ~P9_OWRITE) | P9_ORDWR;
p9_debug(P9_DEBUG_CACHE,
"write-only file with writeback enabled, creating w/ O_RDWR\n");
}