1
0
forked from pool/nfs-utils
nfs-utils/nfs-utils-eperm-fallback.patch
Marcus Meissner cf31e61dcd Accepting request 24935 from home:neilbrown:branches:Base:System
Copy from home:neilbrown:branches:Base:System/nfs-utils via accept of submit request 24935 revision 2.
Request was accepted with message:
ok

OBS-URL: https://build.opensuse.org/request/show/24935
OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=6
2009-11-25 15:22:12 +00:00

29 lines
933 B
Diff

Fall back from v4 to v3 on EPERM.
When the mount version isn't specified, mount.nfs tries v4 and
falls back to v3 if it gets ENOENT.
Linux kernels prior to 2.6.25 will return EPERM if there is no
v4 export, so fall back in that case too.
This fixes bnc#557138 where a 2.6.31 or later kernel client gets
an error when mounting from a 2.6.24 or earlier server.
Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index b595649..68eb82b 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -657,8 +657,10 @@ static int nfs_try_mount(struct nfsmount_info *mi)
* To deal with legacy Linux servers that don't
* automatically export a pseudo root, retry
* ENOENT errors using version 3
+ * And for Linux servers prior to 2.6.25, retry
+ * EPERM
*/
- if (errno != ENOENT)
+ if (errno != ENOENT && errno != EPERM)
break;
}
}