diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-09-12 17:53:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-09-12 17:53:46 -0400 |
commit | 6504d82f4440755d6fc1385532f84d0344243d61 (patch) | |
tree | fee3ccfa544e2279ba55ff60d598c06076d50e40 /fs/nfs/super.c | |
parent | Merge tag 'nfsd-6.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux (diff) | |
parent | Revert "SUNRPC: Remove unreachable error condition" (diff) | |
download | linux-dev-6504d82f4440755d6fc1385532f84d0344243d61.tar.xz linux-dev-6504d82f4440755d6fc1385532f84d0344243d61.zip |
Merge tag 'nfs-for-5.20-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client bugfixes from Trond Myklebust:
- Fix SUNRPC call completion races with call_decode() that trigger a
WARN_ON()
- NFSv4.0 cannot support open-by-filehandle and NFS re-export
- Revert "SUNRPC: Remove unreachable error condition" to allow handling
of error conditions
- Update suid/sgid mode bits after ALLOCATE and DEALLOCATE
* tag 'nfs-for-5.20-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
Revert "SUNRPC: Remove unreachable error condition"
NFSv4.2: Update mode bits after ALLOCATE and DEALLOCATE
NFSv4: Turn off open-by-filehandle and NFS re-export for NFSv4.0
SUNRPC: Fix call completion races with call_decode()
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 82944e14fcea..ee66ffdb985e 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1051,22 +1051,31 @@ static void nfs_fill_super(struct super_block *sb, struct nfs_fs_context *ctx) if (ctx->bsize) sb->s_blocksize = nfs_block_size(ctx->bsize, &sb->s_blocksize_bits); - if (server->nfs_client->rpc_ops->version != 2) { - /* The VFS shouldn't apply the umask to mode bits. We will do - * so ourselves when necessary. + switch (server->nfs_client->rpc_ops->version) { + case 2: + sb->s_time_gran = 1000; + sb->s_time_min = 0; + sb->s_time_max = U32_MAX; + break; + case 3: + /* + * The VFS shouldn't apply the umask to mode bits. + * We will do so ourselves when necessary. */ sb->s_flags |= SB_POSIXACL; sb->s_time_gran = 1; - sb->s_export_op = &nfs_export_ops; - } else - sb->s_time_gran = 1000; - - if (server->nfs_client->rpc_ops->version != 4) { sb->s_time_min = 0; sb->s_time_max = U32_MAX; - } else { + sb->s_export_op = &nfs_export_ops; + break; + case 4: + sb->s_flags |= SB_POSIXACL; + sb->s_time_gran = 1; sb->s_time_min = S64_MIN; sb->s_time_max = S64_MAX; + if (server->caps & NFS_CAP_ATOMIC_OPEN_V1) + sb->s_export_op = &nfs_export_ops; + break; } sb->s_magic = NFS_SUPER_MAGIC; |