]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
allow xfs_freeze to freeze "foreign" filesystems
authorEric Sandeen <sandeen@sandeen.net>
Tue, 10 Feb 2009 20:41:51 +0000 (14:41 -0600)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 10 Feb 2009 20:41:51 +0000 (14:41 -0600)
Now that the freeze ioctl has been elevated to the VFS,
let's let xfs_io and xfs_freeze freeze other filesystems
as well - add the CMD_FOREIGN_OK flag to freeze & thaw.

I think the worst that will happen on older kernels is that
the command will fail with ENOSYS or EINVAL....

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
io/freeze.c
io/xfs_freeze.sh
man/man8/xfs_freeze.8

index 334b0cf7f75b6cfad08f621f355e7795a9f133f0..08f4d47f9b2a4c94993e7ced4e496096def4c308 100644 (file)
@@ -66,14 +66,14 @@ freeze_init(void)
        freeze_cmd.cfunc = freeze_f;
        freeze_cmd.argmin = 0;
        freeze_cmd.argmax = 0;
-       freeze_cmd.flags = CMD_NOMAP_OK;
+       freeze_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
        freeze_cmd.oneline = _("freeze filesystem of current file");
 
        thaw_cmd.name = _("thaw");
        thaw_cmd.cfunc = thaw_f;
        thaw_cmd.argmin = 0;
        thaw_cmd.argmax = 0;
-       thaw_cmd.flags = CMD_NOMAP_OK;
+       thaw_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
        thaw_cmd.oneline = _("unfreeze filesystem of current file");
 
        if (expert) {
index 0aeeae6500b21b3c9b64bb0a64c38ce671b978e0..45e20d27cc08e4b817720af9da2f05c54af545e4 100644 (file)
@@ -33,11 +33,11 @@ if [ "$1" = "" ]; then
 fi
 
 if $FREEZE ; then
-       $DIRNAME/xfs_io -r -p xfs_freeze -x -c "freeze" "$1"
+       $DIRNAME/xfs_io -F -r -p xfs_freeze -x -c "freeze" "$1"
        status=$?
        [ $status -ne 0 ] && exit $status
 elif $THAW ; then
-       $DIRNAME/xfs_io -r -p xfs_freeze -x -c "thaw" "$1"
+       $DIRNAME/xfs_io -F -r -p xfs_freeze -x -c "thaw" "$1"
        status=$?
        [ $status -ne 0 ] && exit $status
 else
index ef5d1ec9f0774a261a1c36566c2ea1455c6ccb62..97c7911996a4864cd67934d663848587aa148621 100644 (file)
@@ -61,6 +61,10 @@ being mounted.
 The XFS
 .B nouuid
 mount option can be used to circumvent this issue.
+.PP
+In Linux kernel version 2.6.29, the interface which XFS uses to freeze
+and unfreeze was elevated to the VFS, so that this tool can now be
+used on many other Linux filesystems.
 .SH SEE ALSO
 .BR xfs (5),
 .BR lvm (8),