- for (exp = exportlist[i].p_head; exp; exp = nxt) {
- nxt = exp->m_next;
- hostname = exp->m_export.e_hostname;
-
- path = strdup(exp->m_export.e_path);
- for (ptr = path + 1; ptr; ptr = strchr(ptr, '/')) {
- int ret;
- char saved;
-
- saved = *ptr;
- *ptr = '\0';
- ret = pseudofs_update(hostname, path, exp);
- /* XXX: error handling */
- *ptr = saved;
- ptr++;
+ for (exp = exportlist[i].p_head; exp; exp = exp->m_next) {
+ if (exp->m_export.e_flags & NFSEXP_V4ROOT)
+ /*
+ * We just added this one, so its
+ * parents are already dealt with!
+ */
+ continue;
+
+ if (strcmp(exp->m_export.e_path, "/") == 0 &&
+ !(exp->m_export.e_flags & NFSEXP_FSID)) {
+ /* Force '/' to be exported as fsid == 0*/
+ exp->m_export.e_flags |= NFSEXP_FSID;
+ exp->m_export.e_fsid = 0;