]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mountd - better response to failed attempts to export filesystems
authorNeil Brown <neilb@suse.de>
Thu, 29 Mar 2007 03:08:01 +0000 (13:08 +1000)
committerNeil Brown <neilb@suse.de>
Thu, 29 Mar 2007 03:08:01 +0000 (13:08 +1000)
If the kernel rejects an attempt to export a filesystem - e.g. because
it is not exportable, we shouldn't just ignore the error, but rather
should tell the kernel that the relevant filehandle or path cannot be supported.

We should really print out some error messages too.

Signed-off-by: Neil Brown <neilb@suse.de>
utils/mountd/cache.c

index e8d72fa0beb1bd366ad213e07e17128ec8c401e9..85e89753c760b81044a2b5b9d535ba3c7d467d6c 100644 (file)
@@ -469,7 +469,8 @@ void nfsd_fh(FILE *f)
        }
 
        if (found)
-               cache_export_ent(dom, found, found_path);
+               if (cache_export_ent(dom, found, found_path) < 0)
+                       found = 0;
 
        qword_print(f, dom);
        qword_printint(f, fsidtype);
@@ -619,8 +620,10 @@ void nfsd_export(FILE *f)
        }
 
        if (found) {
-               dump_to_cache(f, dom, path, &found->m_export);
-               mountlist_add(dom, path);
+               if (dump_to_cache(f, dom, path, &found->m_export) < 0)
+                       dump_to_cache(f, dom, path, NULL);
+               else
+                       mountlist_add(dom, path);
        } else {
                dump_to_cache(f, dom, path, NULL);
        }