9fa08e5
commit 2d77e3a27b7b211f303fcc3a813a044838dad970
9fa08e5
Author: Steve Dickson <steved@redhat.com>
9fa08e5
Date:   Sat Jan 19 07:59:26 2008 -0500
9fa08e5
9fa08e5
    Fix bug when both crossmnt and fsid are set.
9fa08e5
    
9fa08e5
    When exported a filesystems with option inherited (by the crossmnt
9fa08e5
    option) from a higherlevel filesystem, ignore filesystem specific
9fa08e5
    options like FSID and explicit UUID.
9fa08e5
    
9fa08e5
    Signed-off-by: NeilBrown <neilb@suse.de>
9fa08e5
    Signed-off-by: Steve Dickson <steved@redhat.com>
9fa08e5
9fa08e5
diff -up nfs-utils-1.1.1/utils/mountd/cache.c.orig nfs-utils-1.1.1/utils/mountd/cache.c
9fa08e5
--- nfs-utils-1.1.1/utils/mountd/cache.c.orig	2008-01-22 14:15:12.000000000 -0500
9fa08e5
+++ nfs-utils-1.1.1/utils/mountd/cache.c	2008-01-22 14:16:48.000000000 -0500
9fa08e5
@@ -571,20 +571,25 @@ static int dump_to_cache(FILE *f, char *
9fa08e5
 	qword_print(f, path);
9fa08e5
 	qword_printint(f, time(0)+30*60);
9fa08e5
 	if (exp) {
9fa08e5
-		qword_printint(f, exp->e_flags);
9fa08e5
+		int different_fs = strcmp(path, exp->e_path) != 0;
9fa08e5
+		
9fa08e5
+		if (different_fs)
9fa08e5
+			qword_printint(f, exp->e_flags & ~NFSEXP_FSID);
9fa08e5
+		else
9fa08e5
+			qword_printint(f, exp->e_flags);
9fa08e5
 		qword_printint(f, exp->e_anonuid);
9fa08e5
 		qword_printint(f, exp->e_anongid);
9fa08e5
 		qword_printint(f, exp->e_fsid);
9fa08e5
 		write_fsloc(f, exp, path);
9fa08e5
 		write_secinfo(f, exp);
9fa08e5
 #if USE_BLKID
9fa08e5
- 		if (exp->e_uuid == NULL) {
9fa08e5
+ 		if (exp->e_uuid == NULL || different_fs) {
9fa08e5
  			char u[16];
9fa08e5
  			if (get_uuid(path, NULL, 16, u)) {
9fa08e5
  				qword_print(f, "uuid");
9fa08e5
  				qword_printhex(f, u, 16);
9fa08e5
  			}
9fa08e5
- 		} else if (exp->e_uuid) {
9fa08e5
+ 		} else {
9fa08e5
  			qword_print(f, "uuid");
9fa08e5
  			qword_printhex(f, exp->e_uuid, 16);
9fa08e5
  		}