summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Sindholt <opensource@zhasha.com>2024-03-18 14:22:33 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-17 12:43:52 +0300
commit09335c69daa48d930779f4f951d4fcde3c7f67ab (patch)
tree1419ee59b1d08013436337d97a25381a2d972c5a
parentdf1962a199783ecd66734d563caf0fedecf08f96 (diff)
downloadlinux-09335c69daa48d930779f4f951d4fcde3c7f67ab.tar.xz
fs/9p: translate O_TRUNC into OTRUNC
[ Upstream commit 87de39e70503e04ddb58965520b15eb9efa7eef3 ] This one hits both 9P2000 and .u as it appears v9fs has never translated the O_TRUNC flag. Signed-off-by: Joakim Sindholt <opensource@zhasha.com> Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/9p/vfs_inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index b1107b424bf6..ffce168296bd 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -177,6 +177,9 @@ int v9fs_uflags2omode(int uflags, int extended)
break;
}
+ if (uflags & O_TRUNC)
+ ret |= P9_OTRUNC;
+
if (extended) {
if (uflags & O_EXCL)
ret |= P9_OEXCL;