summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-02-10 12:11:05 -0800
committerBrian Behlendorf <[email protected]>2011-02-10 12:14:57 -0800
commitafffb5cd102f340f3879f4d7af8988dd209b9b72 (patch)
tree91aa6a50932b2381a9c030dda8d42c6bd04e1361
parent1ac0ea38a5b19771b0dfbc6b2244c4f674ef1a31 (diff)
MS_DIRSYNC and MS_REC compat
It turns out that older versions of the glibc headers do not properly define MS_DIRSYNC despite it being explicitly mentioned in the man pages. They instead call it S_WRITE, so for system where this is not correct defined map MS_DIRSYNC to S_WRITE. At the time of this commit both Ubuntu Lucid, and Debian Squeeze both use the out of date glibc headers. As for MS_REC this field is also not available in the older headers. Since there is no obvious mapping in this case we simply disable the recursive mount option which used it.
-rw-r--r--cmd/zfs/zfs_main.c2
-rw-r--r--lib/libspl/include/sys/mount.h9
2 files changed, 11 insertions, 0 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index d27fcbf46..86f0d5c39 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -3875,7 +3875,9 @@ static const option_map_t option_map[] = {
#endif
/* Valid options not found in mount(8) */
{ MNTOPT_BIND, MS_BIND },
+#ifdef MS_REC
{ MNTOPT_RBIND, MS_BIND|MS_REC },
+#endif
{ MNTOPT_COMMENT, MS_COMMENT },
{ MNTOPT_BOOTWAIT, MS_COMMENT },
{ MNTOPT_NOBOOTWAIT, MS_COMMENT },
diff --git a/lib/libspl/include/sys/mount.h b/lib/libspl/include/sys/mount.h
index f6a67c6a0..9eb893fe6 100644
--- a/lib/libspl/include/sys/mount.h
+++ b/lib/libspl/include/sys/mount.h
@@ -42,6 +42,15 @@
#define BLKGETSIZE64 _IOR(0x12, 114, size_t)
#endif
+/*
+ * Some old glibc headers don't correctly define MS_DIRSYNC and
+ * instead use the enum name S_WRITE. When using these older
+ * headers define MS_DIRSYNC to be S_WRITE.
+ */
+#if !defined(MS_DIRSYNC)
+#define MS_DIRSYNC S_WRITE
+#endif
+
#define MS_USERS 0x40000000
#define MS_OWNER 0x10000000
#define MS_GROUP 0x08000000