@@ -11,6 +11,12 @@ noinst_HEADERS = nfssvc.h
nfsd_SOURCES = nfsd.c nfssvc.c
nfsd_LDADD = ../../support/nfs/libnfs.la $(LIBTIRPC)
+if CONFIG_REEXPORT
+nfsd_LDADD += ../../support/reexport/libreexport.a $(LIBSQLITE) $(LIBPTHREAD) -lrt
+endif
+
+nfsd_CPPFLAGS = -I$(top_srcdir)/support/reexport
+
MAINTAINERCLEANFILES = Makefile.in
#######################################################################
@@ -29,6 +29,7 @@
#include "nfssvc.h"
#include "xlog.h"
#include "xcommon.h"
+#include "reexport.h"
#ifndef NFSD_NPROC
#define NFSD_NPROC 8
@@ -347,6 +348,15 @@ main(int argc, char **argv)
exit(1);
}
+ /*
+ * Make sure that uncovered NFS subvolumes are present such that
+ * existing file handles continue working.
+ */
+ if (reexpdb_init() == 0) {
+ reexpdb_uncover_subvolumes(NULL);
+ reexpdb_destroy();
+ }
+
/* make sure nfsdfs is mounted if it's available */
nfssvc_mount_nfsdfs(progname);
This will trigger an automount of a subvolume and existing file handles will continue to work. Signed-off-by: Richard Weinberger <richard@nod.at> --- utils/nfsd/Makefile.am | 6 ++++++ utils/nfsd/nfsd.c | 10 ++++++++++ 2 files changed, 16 insertions(+)