From 394e388e1e62d88f2771a3a65ed34c63c1e481bf Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 15 Nov 2016 12:03:24 -0500 Subject: Remove all use of /var/lib/nfs/xtab /var/lib/nfs/xtab is only used to find out what has been exported to the kernel. This is more reliably done by reading /proc/fs/nfs{,d}/export and nfs-utils uses that file if is available. So xtab is only need if you have an incredibly ancient kernel which doesn't have /proc/fs/nfs/export (and so which only supports NFSv2) or if /proc is not mounted. Neither of these are credible contexts to run a modern nfs-utils, so stop creating or reading the xtab file. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson --- utils/exportfs/exportfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'utils/exportfs/exportfs.c') diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c index 5136810..98368a5 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -219,8 +219,6 @@ main(int argc, char **argv) xtab_export_write(); if (new_cache) cache_flush(force_flush); - if (!new_cache) - xtab_mount_write(); return export_errno; } @@ -238,7 +236,7 @@ exports_update_one(nfs_export *exp, int verbose) exp->m_export.e_path, exp->m_export.e_mountpoint); exp->m_mayexport = 0; } - if (exp->m_mayexport && ((exp->m_exported<1) || exp->m_changed)) { + if (exp->m_mayexport && exp->m_changed) { if (verbose) printf("%sexporting %s:%s to kernel\n", exp->m_exported ?"re":"", -- cgit