summaryrefslogtreecommitdiffstats
path: root/utils/exportfs/exportfs.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2008-08-28 11:07:53 -0400
committerSteve Dickson <steved@redhat.com>2008-08-28 11:07:53 -0400
commitec16220910f0bf1bf2b8e1d50e78df7da11d8b1e (patch)
tree5629e67dd6d317032f16943688cd0965a3f1300f /utils/exportfs/exportfs.c
parent3a340251597a5b0c579c31d8caf9aa3b53a77016 (diff)
downloadnfs-utils-ec16220910f0bf1bf2b8e1d50e78df7da11d8b1e.tar.gz
nfs-utils-ec16220910f0bf1bf2b8e1d50e78df7da11d8b1e.tar.xz
nfs-utils-ec16220910f0bf1bf2b8e1d50e78df7da11d8b1e.zip
Stop exportfs warning about needing fsid, when we actually have one
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/exportfs/exportfs.c')
-rw-r--r--utils/exportfs/exportfs.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
index 18dfe5a..fec2571 100644
--- a/utils/exportfs/exportfs.c
+++ b/utils/exportfs/exportfs.c
@@ -12,6 +12,7 @@
#include <config.h>
#endif
+#include <sys/vfs.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
@@ -388,6 +389,8 @@ validate_export(nfs_export *exp)
*/
struct stat stb;
char *path = exp->m_export.e_path;
+ struct statfs64 stf;
+ int fs_has_fsid = 0;
if (stat(path, &stb) < 0) {
fprintf(stderr, "exportfs: Warning: %s does not exist\n",
@@ -403,7 +406,12 @@ validate_export(nfs_export *exp)
if (!can_test())
return;
- if ((exp->m_export.e_flags & NFSEXP_FSID) || exp->m_export.e_uuid) {
+ if (!statfs64(path, &stf) &&
+ (stf.f_fsid.__val[0] || stf.f_fsid.__val[1]))
+ fs_has_fsid = 1;
+
+ if ((exp->m_export.e_flags & NFSEXP_FSID) || exp->m_export.e_uuid ||
+ fs_has_fsid) {
if ( !test_export(path, 1)) {
fprintf(stderr, "exportfs: Warning: %s does not "
"support NFS export.\n",