ChenXiaoSong
45b9932b4d
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: ce4ef7c0a8
("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 21:01:04 +02:00
..
2020-08-23 17:36:59 -05:00
2021-06-03 09:00:35 +02:00
2021-11-18 14:04:22 +01:00
2017-11-17 14:18:00 -08:00
2017-11-17 14:18:00 -08:00
2022-04-08 14:40:30 +02:00
2022-04-08 14:40:27 +02:00
2019-04-24 09:46:35 -04:00
2022-02-16 12:54:18 +01:00
2022-02-16 12:54:17 +01:00
2021-07-20 16:05:47 +02:00
2021-07-20 16:05:47 +02:00
2022-04-13 21:01:04 +02:00
2022-04-13 21:01:02 +02:00
2020-05-27 10:10:12 -04:00
2017-11-02 11:10:55 +01:00
2019-11-03 21:28:46 -05:00
2022-04-13 21:01:02 +02:00
2021-05-11 14:47:34 +02:00
2020-01-15 10:54:30 -05:00
2020-05-08 22:20:24 +01:00
2020-01-15 10:54:30 -05:00
2020-03-30 19:56:50 -04:00
2022-04-13 21:01:04 +02:00
2022-04-13 21:01:04 +02:00
2019-02-20 15:14:21 -05:00
2017-11-02 11:10:55 +01:00
2021-03-30 14:31:49 +02:00
2020-07-13 17:52:46 -04:00
2020-05-14 18:42:44 -04:00
2020-10-06 10:21:18 -04:00
2019-07-06 14:54:49 -04:00
2019-05-21 10:50:45 +02:00
2022-04-08 14:40:25 +02:00
2020-01-15 10:15:17 -05:00
2020-08-23 17:36:59 -05:00
2020-01-15 10:15:17 -05:00
2021-07-20 16:05:51 +02:00
2019-05-21 10:50:45 +02:00
2022-04-08 14:40:25 +02:00
2022-02-16 12:54:18 +01:00
2022-02-16 12:54:18 +01:00
2022-04-13 21:01:04 +02:00
2017-11-02 11:10:55 +01:00
2021-11-18 14:04:23 +01:00
2015-04-23 15:16:14 -04:00
2022-02-16 12:54:18 +01:00
2022-04-08 14:40:29 +02:00
2020-02-04 12:27:55 -05:00
2019-05-21 10:50:45 +02:00
2019-03-02 16:25:26 -05:00
2022-04-13 21:01:01 +02:00
2021-01-19 18:27:30 +01:00
2018-01-18 15:10:47 -05:00
2020-01-15 10:54:33 -05:00
2020-10-02 08:43:09 -04:00
2022-02-16 12:54:18 +01:00
2020-07-13 17:52:45 -04:00
2022-04-13 21:01:01 +02:00
2020-11-12 10:40:02 -05:00
2021-12-01 09:19:03 +01:00
2017-11-02 11:10:55 +01:00
2020-11-02 10:29:03 -05:00
2019-02-13 12:03:21 -05:00
2020-07-13 17:52:45 -04:00
2022-04-13 21:01:03 +02:00
2019-03-01 22:37:38 -05:00
2022-04-13 21:01:03 +02:00
2022-04-08 14:40:30 +02:00
2022-04-08 14:40:30 +02:00
2020-01-24 16:51:13 -05:00
2020-06-11 13:33:48 -04:00
2020-10-22 09:44:27 -07:00
2019-05-09 16:26:57 -04:00
2017-11-02 11:10:55 +01:00
2020-10-15 13:31:08 -04:00
2020-10-15 13:31:08 -04:00
2020-03-16 08:34:29 -04:00
2022-04-13 21:01:03 +02:00