From: Timo Sirainen Date: Mon, 9 Aug 2010 16:35:08 +0000 (+0100) Subject: mountpoint_get(): Skip rootfs mounts with Linux. X-Git-Tag: 2.0.rc5~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26bedc1f8aace67ff8f19f625a403a097017845a;p=thirdparty%2Fdovecot%2Fcore.git mountpoint_get(): Skip rootfs mounts with Linux. Fixes fs quota for such systems. Patch by Patrick McLean. --- diff --git a/src/lib/mountpoint.c b/src/lib/mountpoint.c index f0ddeb6e87..16614faeb4 100644 --- a/src/lib/mountpoint.c +++ b/src/lib/mountpoint.c @@ -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 @@ int mountpoint_get(const char *path, pool_t pool, struct mountpoint *point_r) } 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 &&