Call getmntinfo with MNT_NOWAIT to avoid hanging if any NFS servers
are down. Avoid trying to send RPCs to the pidXXX@machine names used in the special amd(8) mounts. PR: bin/6183 Submitted by: Petr Lampa <lampa@fee.vutbr.cz>
This commit is contained in:
parent
86a7fd100f
commit
ab5ff6a601
@ -449,7 +449,7 @@ getprivs(long id, int quotatype)
|
|||||||
|
|
||||||
qup = quphead = (struct quotause *)0;
|
qup = quphead = (struct quotause *)0;
|
||||||
|
|
||||||
nfst = getmntinfo(&fst, MNT_WAIT);
|
nfst = getmntinfo(&fst, MNT_NOWAIT);
|
||||||
if (nfst == 0)
|
if (nfst == 0)
|
||||||
errx(2, "no filesystems mounted!");
|
errx(2, "no filesystems mounted!");
|
||||||
setfsent();
|
setfsent();
|
||||||
@ -597,6 +597,13 @@ getnfsquota(struct statfs *fst, struct quotause *qup, long id, int quotatype)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Avoid attempting the RPC for special amd(8) filesystems. */
|
||||||
|
if (strncmp(fst->f_mntfromname, "pid", 3) == 0 &&
|
||||||
|
strchr(fst->f_mntfromname, '@') != NULL) {
|
||||||
|
*cp = ':';
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
gq_args.gqa_pathp = cp + 1;
|
gq_args.gqa_pathp = cp + 1;
|
||||||
gq_args.gqa_uid = id;
|
gq_args.gqa_uid = id;
|
||||||
if (callaurpc(fst->f_mntfromname, RQUOTAPROG, RQUOTAVERS,
|
if (callaurpc(fst->f_mntfromname, RQUOTAPROG, RQUOTAVERS,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user