]> granicus.if.org Git - zfs/commitdiff
Remount datasets for "zfs inherit".
authorGunnar Beutner <gunnar@beutner.name>
Fri, 21 Mar 2014 12:27:18 +0000 (13:27 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 24 Mar 2014 18:11:15 +0000 (11:11 -0700)
Changing properties with "zfs inherit" should cause the datasets
to be remounted.  This ensures that the modified property values
will be propagated in to the filesystem namespace where they can
be enforced.  This change is modeled after an identical fix made
to zfs_prop_set().

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2201

lib/libzfs/libzfs_dataset.c

index e517e06bc36ac4ccf48db843d472f6c80bbcefb6..55325310875cd0cee1c7517d53f1820dae8968b4 100644 (file)
@@ -1655,6 +1655,15 @@ zfs_prop_inherit(zfs_handle_t *zhp, const char *propname, boolean_t received)
                 * Refresh the statistics so the new property is reflected.
                 */
                (void) get_stats(zhp);
+
+               /*
+                * Remount the filesystem to propagate the change
+                * if one of the options handled by the generic
+                * Linux namespace layer has been modified.
+                */
+               if (zfs_is_namespace_prop(prop) &&
+                   zfs_is_mounted(zhp, NULL))
+                       ret = zfs_mount(zhp, MNTOPT_REMOUNT, 0);
        }
 
 error: