From 740a5434e9d6d6277529b683fb8c69a23fac7fd4 Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Sat, 21 Sep 2019 00:17:40 +0000 Subject: [PATCH] Add a workaround for servers which respond RPC_PROGNOTREGISTERED to a clnt_create() call even when it is actually a program version mismatch. Normally the server is supposed to return RPC_PROGVERSMISMATCH when it supports the specified program but not support the specified version. Some filers return RPC_PROGNOTREGISTERED to RQUOTA v2 calls and FreeBSD does not retry with the old v1 calls. This change fixes this failure scenario. Submitted by: Jian-Bo Liao PR: 236179 --- usr.bin/quota/quota.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c index f4481fecece..71e63208884 100644 --- a/usr.bin/quota/quota.c +++ b/usr.bin/quota/quota.c @@ -606,7 +606,7 @@ getnfsquota(struct statfs *fst, struct quotause *qup, long id, int quotatype) call_stat = callaurpc(host, RQUOTAPROG, EXT_RQUOTAVERS, RQUOTAPROC_GETQUOTA, (xdrproc_t)xdr_ext_getquota_args, (char *)&gq_args, (xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt); - if (call_stat == RPC_PROGVERSMISMATCH) { + if (call_stat == RPC_PROGVERSMISMATCH || call_stat == RPC_PROGNOTREGISTERED) { if (quotatype == USRQUOTA) { old_gq_args.gqa_pathp = cp + 1; old_gq_args.gqa_uid = id;