Skip to contentSkip to conversation

xfsprogs: allow xfs_freeze to work on non-xfs filesystems

PATCH In review Eric Sandeen 3 participants 4 messages Jan 14, 2009 – Jan 18, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfsprogs: allow xfs_freeze to work on non-xfs filesystems

allow xfs_freeze to freeze "foreign" filesystems

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....

---

io/freeze.c +2 -2
index 334b0cf..08f4d47 100644
@@ -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) {
io/xfs_freeze.sh +2 -2
index 0aeeae6..45e20d2 100644
@@ -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

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#1 lore raw

On Wed, Jan 14, 2009 at 05:05:24PM -0600, Eric Sandeen wrote:

| allow xfs_freeze to freeze "foreign" filesystems
| 
| 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 <[email protected]>
| ---

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
In reply to Eric Sandeen
Quoted 8 lines · Eric Sandeen

allow xfs_freeze to freeze "foreign" filesystems

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....

Looks good to me, but I thikn you should also update the xfs_freeze manpage to mention that it works for non-XFS filesystems on 2.6.29 or newer kernels.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 6 lines · Eric Sandeen

allow xfs_freeze to freeze "foreign" filesystems

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.

Quoted 6 lines
Quoted 2 lines

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

Looks good to me, but I thikn you should also update the xfs_freeze manpage to mention that it works for non-XFS filesystems on 2.6.29 or newer kernels.

Ok, will do - thanks.

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs