From 2cf7f52bc42f215d4ef27d0fd75fc1b1417cb841 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 19 May 2011 11:44:07 -0700 Subject: Linux compat 2.6.39: mount_nodev() The .get_sb callback has been replaced by a .mount callback in the file_system_type structure. When using the new interface the caller must now use the mount_nodev() helper. Unfortunately, the new interface no longer passes the vfsmount down to the zfs layers. This poses a problem for the existing implementation because we currently save this pointer in the super block for latter use. It provides our only entry point in to the namespace layer for manipulating certain mount options. This needed to be done originally to allow commands like 'zfs set atime=off tank' to work properly. It also allowed me to keep more of the original Solaris code unmodified. Under Solaris there is a 1-to-1 mapping between a mount point and a file system so this is a fairly natural thing to do. However, under Linux they many be multiple entries in the namespace which reference the same filesystem. Thus keeping a back reference from the filesystem to the namespace is complicated. Rather than introduce some ugly hack to get the vfsmount and continue as before. I'm leveraging this API change to update the ZFS code to do things in a more natural way for Linux. This has the upside that is resolves the compatibility issue for the long term and fixes several other minor bugs which have been reported. This commit updates the code to remove this vfsmount back reference entirely. All modifications to filesystem mount options are now passed in to the kernel via a '-o remount'. This is the expected Linux mechanism and allows the namespace to properly handle any options which apply to it before passing them on to the file system itself. Aside from fixing the compatibility issue, removing the vfsmount has had the benefit of simplifying the code. This change which fairly involved has turned out nicely. Closes #246 Closes #217 Closes #187 Closes #248 Closes #231 --- etc/Makefile.in | 1 + etc/init.d/Makefile.in | 1 + etc/udev/Makefile.in | 1 + etc/udev/rules.d/Makefile.in | 1 + etc/zfs/Makefile.in | 1 + 5 files changed, 5 insertions(+) (limited to 'etc') diff --git a/etc/Makefile.in b/etc/Makefile.in index 74cb03ced..06e5fbedd 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -61,6 +61,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-insert-inode-locked.m4 \ $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \ $(top_srcdir)/config/kernel-kobj-name-len.m4 \ + $(top_srcdir)/config/kernel-mount-nodev.m4 \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ diff --git a/etc/init.d/Makefile.in b/etc/init.d/Makefile.in index 9475c9c73..53f5457b6 100644 --- a/etc/init.d/Makefile.in +++ b/etc/init.d/Makefile.in @@ -61,6 +61,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-insert-inode-locked.m4 \ $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \ $(top_srcdir)/config/kernel-kobj-name-len.m4 \ + $(top_srcdir)/config/kernel-mount-nodev.m4 \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ diff --git a/etc/udev/Makefile.in b/etc/udev/Makefile.in index c2c2ec18e..f4754b8ff 100644 --- a/etc/udev/Makefile.in +++ b/etc/udev/Makefile.in @@ -61,6 +61,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-insert-inode-locked.m4 \ $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \ $(top_srcdir)/config/kernel-kobj-name-len.m4 \ + $(top_srcdir)/config/kernel-mount-nodev.m4 \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ diff --git a/etc/udev/rules.d/Makefile.in b/etc/udev/rules.d/Makefile.in index 67145b0a4..98b0d2fdb 100644 --- a/etc/udev/rules.d/Makefile.in +++ b/etc/udev/rules.d/Makefile.in @@ -62,6 +62,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-insert-inode-locked.m4 \ $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \ $(top_srcdir)/config/kernel-kobj-name-len.m4 \ + $(top_srcdir)/config/kernel-mount-nodev.m4 \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ diff --git a/etc/zfs/Makefile.in b/etc/zfs/Makefile.in index 62bac1b3b..08d1b6a4e 100644 --- a/etc/zfs/Makefile.in +++ b/etc/zfs/Makefile.in @@ -62,6 +62,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-insert-inode-locked.m4 \ $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \ $(top_srcdir)/config/kernel-kobj-name-len.m4 \ + $(top_srcdir)/config/kernel-mount-nodev.m4 \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ -- cgit v1.2.3