From 9ccc43210c721dd5c28e5d31d061b02c81f93199 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Wed, 23 Jan 2019 14:51:23 +0100 Subject: [PATCH] make-automaps: add -vers=4.0 to all nfs mounts Since a few days we have some severe nfs problems with the server continuously logging "RPC request reserved 84 but used 276" and the affected client blocking. This may be related to the fact, that after the last update of nfs-utils the mount.nfs command now supports nfs4.1 so that new mounts are done with nfs4.1 (or nfs4.2 if the server kernel supports it) and not with nfs4.0 as before. Some bug reports on the internet suggest, that the problem does not exist with nfs4.0 [1]. Change make-automaps to add -vers=4.0 to all location entries of all maps. Experiments confirmed, that this (nfs-specific) option doesn not interfere with bind mounts, when the location is on the local host. [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1552037 --- make-automaps/make-automaps | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/make-automaps/make-automaps b/make-automaps/make-automaps index 054f8f9..7cb1168 100755 --- a/make-automaps/make-automaps +++ b/make-automaps/make-automaps @@ -22,13 +22,13 @@ sub convert_map { sub parse_jbod_line { my ($in,$source)=@_; if ($in=~m"^(X\d+)\s+host==([^;]+);type:=link;fs:=/amd/\2/X/\1 host!=\2;type:=nfs;rhost:=\2;fs:=/amd/\2/x/\1;rfs:=/amd/\2/X/\1$") { - return "$1 $2:/amd/$2/X/$1"; + return "$1 -vers=4.0 $2:/amd/$2/X/$1"; } elsif ($in=~m"^(C\d+)\s+host==([^;]+);type:=link;fs:=/amd/\2/C/\1 host!=\2;type:=nfs;rhost:=\2;fs:=/amd/\2/c/\1;rfs:=/amd/\2/C/\1$") { - return "$1 $2:/amd/$2/C/$1"; + return "$1 -vers=4.0 $2:/amd/$2/C/$1"; } elsif ($in=~m"^(M\d+)\s+host==([^;]+);type:=link;fs:=/amd/\2/M/\1 host!=\2;type:=nfs;rhost:=\2;fs:=/amd/\2/m/\1;rfs:=/amd/\2/M/\1$") { - return "$1 $2:/amd/$2/M/$1"; + return "$1 -vers=4.0 $2:/amd/$2/M/$1"; } elsif ($in=~m"^(X\d+)\s+-fs:=/amd/([^/]+)/X/\1 host==\2;type:=link host!=\2;type:=nfs;rhost:=\2") { - return "$1 $2:/amd/$2/X/$1"; + return "$1 -vers=4.0 $2:/amd/$2/X/$1"; } else { warn "?? $source : $_ ??"; } @@ -68,8 +68,8 @@ sub parse_map_line { return (); } -sub parse_subkey_line { my ($key,$host,$fs)=parse_map_line(@_); return $key ? "$key $host:$fs/$key" : undef; } -sub parse_nosubkey_line { my ($key,$host,$fs)=parse_map_line(@_); return $key ? "$key $host:$fs" : undef; } +sub parse_subkey_line { my ($key,$host,$fs)=parse_map_line(@_); return $key ? "$key -vers=4.0 $host:$fs/$key" : undef; } +sub parse_nosubkey_line { my ($key,$host,$fs)=parse_map_line(@_); return $key ? "$key -vers=4.0 $host:$fs" : undef; } sub create_pkg_map { my $cache; @@ -82,7 +82,7 @@ sub create_pkg_map { /\S/ or next; my ($pkg,$flags)=split ' '; my $local="/var/pkg/$pkg"; - my $rw = $flags eq 'BUILD' ? ' -rw' : ''; + my $rw = $flags eq 'BUILD' ? ' -vers=4.0,rw' : ' -vers=4.0'; if (-d $local) { print $out "$pkg$rw :$local\n"; } else {