summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2023-04-18 15:19:02 -0400
committerSteve Dickson <steved@redhat.com>2023-04-19 10:41:05 -0400
commit350605533bacd885b216844d6a2b50ed6c6f3f76 (patch)
tree9db2650fad3e32c2246392007f5522eafcd4d1f1
parentccf3ae701a69785c85a0d1f505f603ca2b6044e5 (diff)
downloadnfs-utils-350605533bacd885b216844d6a2b50ed6c6f3f76.tar.gz
export: Uncover NFS subvolume after reboot
When a re-exporting NFS server reboots, none of the subvolumes are present. This is because the NFS client code will mount only upon first access. So, when we see an NFS handle with an yet unknown fsidnum, lookup in the reexport database for it. If one is found, stat the path to trigger the mount. That way stale NFS handles are avoided after a reboot. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--support/export/cache.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/support/export/cache.c b/support/export/cache.c
index 42a694d..19bbba5 100644
--- a/support/export/cache.c
+++ b/support/export/cache.c
@@ -778,6 +778,7 @@ static void nfsd_fh(int f)
int dev_missing = 0;
char buf[RPC_CHAN_BUF_SIZE], *bp;
int blen;
+ int did_uncover = 0;
blen = cache_read(f, buf, sizeof(buf));
if (blen <= 0 || buf[blen-1] != '\n') return;
@@ -815,6 +816,11 @@ static void nfsd_fh(int f)
for (exp = exportlist[i].p_head; exp; exp = next_exp) {
char *path;
+ if (!did_uncover && parsed.fsidnum && parsed.fsidtype == FSID_NUM && exp->m_export.e_reexport != REEXP_NONE) {
+ reexpdb_uncover_subvolume(parsed.fsidnum);
+ did_uncover = 1;
+ }
+
if (exp->m_export.e_flags & NFSEXP_CROSSMOUNT) {
static nfs_export *prev = NULL;
static void *mnt = NULL;