Skip to content

Commit 21e26d5

Browse files
committed
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>
1 parent 4eb3117 commit 21e26d5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fs/9p/vfs_inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
823823
p9_omode = v9fs_uflags2omode(flags, v9fs_proto_dotu(v9ses));
824824

825825
if ((v9ses->cache & CACHE_WRITEBACK) && (p9_omode & P9_OWRITE)) {
826-
p9_omode = (p9_omode & !P9_OWRITE) | P9_ORDWR;
826+
p9_omode = (p9_omode & ~P9_OWRITE) | P9_ORDWR;
827827
p9_debug(P9_DEBUG_CACHE,
828828
"write-only file with writeback enabled, creating w/ O_RDWR\n");
829829
}

fs/9p/vfs_inode_dotl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
288288
}
289289

290290
if ((v9ses->cache & CACHE_WRITEBACK) && (p9_omode & P9_OWRITE)) {
291-
p9_omode = (p9_omode & !P9_OWRITE) | P9_ORDWR;
291+
p9_omode = (p9_omode & ~P9_OWRITE) | P9_ORDWR;
292292
p9_debug(P9_DEBUG_CACHE,
293293
"write-only file with writeback enabled, creating w/ O_RDWR\n");
294294
}

0 commit comments

Comments
 (0)