Refuse to attach inode partitions with UFS logging
authorAndrew Deason <adeason@sinenomine.net>
Fri, 18 Dec 2009 18:17:41 +0000 (12:17 -0600)
committerDerrick Brashear <shadow|account-1000005@unknown>
Tue, 5 Jan 2010 18:19:56 +0000 (10:19 -0800)
Partitions with the 'logging' UFS mount option are known to cause
corruption when using the inode fileserver backend. So, if we detect
that we are attempting to attach a 'logging' partition, refuse to attach
it.

Change-Id: I0ee23b9935ac6ffc66e6228fe03d6bbfb5d64574
Reviewed-on: http://gerrit.openafs.org/999
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/vol/partition.c

index cb339e8..f644271 100644 (file)
@@ -468,6 +468,18 @@ VAttachPartitions(void)
        if (VIsAlwaysAttach(mnt.mnt_mountp))
            continue;
 
+#ifndef AFS_NAMEI_ENV
+       if (hasmntopt(&mnt, "logging") != NULL) {
+           Log("This program is compiled without AFS_NAMEI_ENV, and "
+               "partition %s is mounted with the 'logging' option. "
+               "Using the inode fileserver backend with 'logging' UFS "
+               "partitions causes volume corruption, so please either "
+               "mount the partition without logging, or use the namei "
+               "fileserver backend. Aborting...\n", mnt.mnt_mountp);
+           errors++;
+       }
+#endif /* !AFS_NAMEI_ENV */
+
        if (VCheckPartition(mnt.mnt_mountp, mnt.mnt_special) < 0)
            errors++;
     }