mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
NFS: Add mount option 'softreval'
Add a mount option 'softreval' that allows attribute revalidation 'getattr' calls to time out, and causes them to fall back to using the cached attributes. The use case for this option is for ensuring that we can still (slowly) traverse paths and use cached information even when the server is down. Once the server comes back up again, the getattr calls start succeeding, and the caches will revalidate as usual. The 'softreval' mount option is automatically enabled if you have specified 'softerr'. It can be turned off using the options 'nosoftreval', or 'hard'. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
committed by
Anna Schumaker
parent
5c965db86e
commit
c74dfe97c1
@@ -73,6 +73,7 @@ enum nfs_param {
|
||||
Opt_sloppy,
|
||||
Opt_soft,
|
||||
Opt_softerr,
|
||||
Opt_softreval,
|
||||
Opt_source,
|
||||
Opt_tcp,
|
||||
Opt_timeo,
|
||||
@@ -128,6 +129,7 @@ static const struct fs_parameter_spec nfs_param_specs[] = {
|
||||
fsparam_flag ("sloppy", Opt_sloppy),
|
||||
fsparam_flag ("soft", Opt_soft),
|
||||
fsparam_flag ("softerr", Opt_softerr),
|
||||
fsparam_flag ("softreval", Opt_softreval),
|
||||
fsparam_string("source", Opt_source),
|
||||
fsparam_flag ("tcp", Opt_tcp),
|
||||
fsparam_u32 ("timeo", Opt_timeo),
|
||||
@@ -460,11 +462,19 @@ static int nfs_fs_context_parse_param(struct fs_context *fc,
|
||||
ctx->flags &= ~NFS_MOUNT_SOFTERR;
|
||||
break;
|
||||
case Opt_softerr:
|
||||
ctx->flags |= NFS_MOUNT_SOFTERR;
|
||||
ctx->flags |= NFS_MOUNT_SOFTERR | NFS_MOUNT_SOFTREVAL;
|
||||
ctx->flags &= ~NFS_MOUNT_SOFT;
|
||||
break;
|
||||
case Opt_hard:
|
||||
ctx->flags &= ~(NFS_MOUNT_SOFT|NFS_MOUNT_SOFTERR);
|
||||
ctx->flags &= ~(NFS_MOUNT_SOFT |
|
||||
NFS_MOUNT_SOFTERR |
|
||||
NFS_MOUNT_SOFTREVAL);
|
||||
break;
|
||||
case Opt_softreval:
|
||||
if (result.negated)
|
||||
ctx->flags &= ~NFS_MOUNT_SOFTREVAL;
|
||||
else
|
||||
ctx->flags &= NFS_MOUNT_SOFTREVAL;
|
||||
break;
|
||||
case Opt_posix:
|
||||
if (result.negated)
|
||||
|
Reference in New Issue
Block a user