walters / rpms / nfs-utils

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