Whamcloud - gitweb
tune2fs: allow changing the UUID mounted file systems with the -f option
authorTheodore Ts'o <tytso@mit.edu>
Sun, 6 Sep 2015 02:21:35 +0000 (22:21 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 6 Sep 2015 02:21:35 +0000 (22:21 -0400)
There are times when it is necessary to update the UUID on a mounted
root file system (for example).  So when we add this this safety check
to e2fsprogs 1.43, we will likely break some scripts.  Allow the -f
option to force an override of this safety check.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/tune2fs.c

index f9ce38c..2f27d6f 100644 (file)
@@ -2960,7 +2960,7 @@ retry_open:
                         * Changing the UUID requires rewriting all metadata,
                         * which can race with a mounted fs.  Don't allow that.
                         */
-                       if (mount_flags & EXT2_MF_MOUNTED) {
+                       if ((mount_flags & EXT2_MF_MOUNTED) && !f_flag) {
                                fputs(_("The UUID may only be "
                                        "changed when the filesystem is "
                                        "unmounted.\n"), stderr);