X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmountd%2Fmountd.c;h=b59f939ee71154e2bd1ec3535c4d7987ea26e1db;hp=25d292bdc5efeafc8f82362343723986018dd64d;hb=abf92485ae52bd637d544e2ac73147271b310a14;hpb=f0ed8401e854e1cbd23b2fb5dca5e88dec2df7c4 diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index 25d292b..b59f939 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -467,8 +467,12 @@ get_rootfh(struct svc_req *rqstp, dirpath *path, nfs_export **expret, return NULL; } } else { - if (exp->m_exported<1) + int did_export = 0; + retry: + if (exp->m_exported<1) { export_export(exp); + did_export = 1; + } if (!exp->m_xtabent) xtab_append(exp); @@ -482,6 +486,11 @@ get_rootfh(struct svc_req *rqstp, dirpath *path, nfs_export **expret, fh = getfh_old ((struct sockaddr *) sin, stb.st_dev, stb.st_ino); } + if (fh == NULL && !did_export) { + exp->m_exported = 0; + goto retry; + } + if (fh == NULL) { xlog(L_WARNING, "getfh failed: %s", strerror(errno)); *error = NFSERR_ACCES;