ChenXiaoSong
6f52d4cda0
NFSv4: fix open failure with O_ACCMODE flag
...
[ Upstream commit b243874f6f9568b2daf1a00e9222cacdc15e159c ]
open() with O_ACCMODE|O_DIRECT flags secondly will fail.
Reproducer:
1. mount -t nfs -o vers=4.2 $server_ip:/ /mnt/
2. fd = open("/mnt/file", O_ACCMODE|O_DIRECT|O_CREAT)
3. close(fd)
4. fd = open("/mnt/file", O_ACCMODE|O_DIRECT)
Server nfsd4_decode_share_access() will fail with error nfserr_bad_xdr when
client use incorrect share access mode of 0.
Fix this by using NFS4_SHARE_ACCESS_BOTH share access mode in client,
just like firstly opening.
Fixes: ce4ef7c0a8a05 ("NFS: Split out NFS v4 file operations")
Signed-off-by: ChenXiaoSong <chenxiaosong2@huawei.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-13 20:59:15 +02:00
..
2021-02-26 15:49:51 -07:00
2021-05-20 12:17:08 -04:00
2021-11-18 19:17:00 +01:00
2022-04-08 14:23:54 +02:00
2022-04-08 14:23:48 +02:00
2021-08-10 14:18:35 -04:00
2022-02-16 12:56:08 +01:00
2022-02-16 12:56:09 +01:00
2021-06-13 19:36:28 -04:00
2021-06-13 19:36:27 -04:00
2022-04-13 20:59:15 +02:00
2022-04-13 20:59:13 +02:00
2020-05-27 10:10:12 -04:00
2021-08-26 15:32:10 -04:00
2022-04-13 20:59:12 +02:00
2021-08-27 16:37:17 -04:00
2021-07-08 14:03:26 -04:00
2021-06-28 09:34:39 -04:00
2022-04-13 20:59:14 +02:00
2022-04-13 20:59:15 +02:00
2021-04-05 09:04:20 -04:00
2021-03-08 11:47:47 -05:00
2020-07-13 17:52:46 -04:00
2021-04-05 09:04:21 -04:00
2021-05-27 09:19:33 -04:00
2022-04-08 14:23:46 +02:00
2021-08-18 22:08:24 +02:00
2021-08-18 22:08:24 +02:00
2021-08-27 16:36:21 -04:00
2022-04-08 14:23:46 +02:00
2022-02-16 12:56:10 +01:00
2022-02-16 12:56:08 +01:00
2022-04-13 20:59:15 +02:00
2021-11-18 19:17:02 +01:00
2022-02-16 12:56:10 +01:00
2022-04-08 14:23:51 +02:00
2021-05-07 00:26:34 -07:00
2020-12-14 06:51:07 -05:00
2022-04-13 20:59:12 +02:00
2021-01-10 13:32:39 -05:00
2021-06-30 09:19:14 -04:00
2022-02-16 12:56:09 +01:00
2020-07-13 17:52:45 -04:00
2022-04-13 20:59:11 +02:00
2021-04-05 09:04:20 -04:00
2021-12-01 09:04:47 +01:00
2020-11-02 10:29:03 -05:00
2021-04-14 09:36:29 -04:00
2021-07-03 11:41:14 -07:00
2022-04-13 20:59:13 +02:00
2020-12-16 17:25:24 -05:00
2022-04-13 20:59:13 +02:00
2022-04-08 14:23:54 +02:00
2022-04-08 14:23:54 +02:00
2022-04-08 14:22:52 +02:00
2021-08-30 13:21:38 -04:00
2021-08-27 16:37:17 -04:00
2020-10-15 13:31:08 -04:00
2020-10-15 13:31:08 -04:00
2021-03-08 16:13:55 -05:00
2022-04-13 20:59:13 +02:00