changeset 11966:3f5c53f84d0a

mountpoint_get(): Skip rootfs mounts with Linux. Fixes fs quota for such systems. Patch by Patrick McLean.
author Timo Sirainen <tss@iki.fi>
date Mon, 09 Aug 2010 17:35:08 +0100
parents 18d95a2d0aba
children ed61aee681b8
files src/lib/mountpoint.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/mountpoint.c	Mon Aug 09 16:58:33 2010 +0100
+++ b/src/lib/mountpoint.c	Mon Aug 09 17:35:08 2010 +0100
@@ -47,6 +47,11 @@
 #  define MNTTYPE_NFS "nfs"
 #endif
 
+/* Linux sometimes has mtab entry for "rootfs" as well as the real root
+   entry. Skip the rootfs. */
+#ifndef MNTTYPE_ROOTFS
+#  define MNTTYPE_ROOTFS "rootfs"
+#endif
 
 int mountpoint_get(const char *path, pool_t pool, struct mountpoint *point_r)
 {
@@ -191,7 +196,8 @@
 	}
 	while ((ent = getmntent(f)) != NULL) {
 		if (strcmp(ent->mnt_type, MNTTYPE_SWAP) == 0 ||
-		    strcmp(ent->mnt_type, MNTTYPE_IGNORE) == 0)
+		    strcmp(ent->mnt_type, MNTTYPE_IGNORE) == 0 ||
+		    strcmp(ent->mnt_type, MNTTYPE_ROOTFS) == 0)
 			continue;
 
 		if (stat(ent->mnt_dir, &st2) == 0 &&