X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmountd%2Fcache.c;h=0af640441b9b86eab0f0dd023f8ed985b4b4d410;hp=b01c0bdb4e944286a03664c33c53bb922999e04a;hb=12a31b8011ab258fc726300dcfbb7a03af74adb3;hpb=8ed7383f1b1766f12a3ad3d6259e5e9e37b64727 diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index b01c0bd..0af6404 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -596,11 +596,20 @@ static void nfsd_fh(FILE *f) found_path = strdup(path); if (found_path == NULL) goto out; - } else if (strcmp(found->e_path, exp->m_export.e_path) + } else if (strcmp(found->e_path, exp->m_export.e_path) != 0 && !subexport(found, &exp->m_export)) { xlog(L_WARNING, "%s and %s have same filehandle for %s, using first", found_path, path, dom); + } else { + /* same path, if one is V4ROOT, choose the other */ + if (found->e_flags & NFSEXP_V4ROOT) { + found = &exp->m_export; + free(found_path); + found_path = strdup(path); + if (found_path == NULL) + goto out; + } } } }