public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/10] freeze feature ver 1.13
@ 2008-09-26  8:56 Takashi Sato
  2008-09-26 10:48 ` Valdis.Kletnieks
  0 siblings, 1 reply; 3+ messages in thread
From: Takashi Sato @ 2008-09-26  8:56 UTC (permalink / raw)
  To: Andrew Morton, Christoph Hellwig, linux-fsdevel@vger.kernel.org,
	dm-devel@redhat.com, viro@ZenIV.linux.org.uk,
	linux-ext4@vger.kernel.org, xfs@oss.sgi.com,
	mtk.manpages@googlemail.com, axboe@kernel.dk
  Cc: linux-kernel@vger.kernel.org

Hi, 

I've addressed the comments from Christoph, Steve, Dave, Shaggy and Eric.
The points are followings.

- Fixed unlockfs method in ext3/4, xfs, gfs2, jfs and reiserfs
  so that they always return 0 (success).
  Because the caller (thaw_bdev()) should unfreeze a filesystem
  successfully even in case of unlockfs's failure.

- Fixed xfs's write_super_lockfs so that it returns an error
  of xfs_trans_reserve() and xfs_trans_commit().

- Fixed gfs2's write_super_lockfs so that it returns -EINVAL
  in the following case.
>      if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
> -        return;
> +        return -EINVAL;

- Rename write_super_lockfs/unlockfs of the super block operation
  freeze_fs/unfreeze_fs to avoid a confusion.

Currently, ext3 in mainline Linux doesn't have the freeze feature which
suspends write requests.  So, we cannot take a backup which keeps
the filesystem's consistency with the storage device's features
(snapshot and replication) while it is mounted.
In many case, a commercial filesystem (e.g. VxFS) has
the freeze feature and it would be used to get the consistent backup.
If Linux's standard filesystem ext3 has the freeze feature, we can do it
without a commercial filesystem.

So I have implemented the ioctls of the freeze feature.
I think we can take the consistent backup with the following steps.
1. Freeze the filesystem with the freeze ioctl.
2. Separate the replication volume or create the snapshot
   with the storage device's feature.
3. Unfreeze the filesystem with the unfreeze ioctl.
4. Take the backup from the separated replication volume
   or the snapshot.

[PATCH 1/10] VFS: Fix error handling of write_super_lockfs/unlockfs
  Changed the type of write_super_lockfs and unlockfs from "void"
  to "int" so that they can return an error. 
  Rename write_super_lockfs/unlockfs of the super block operation
  freeze_fs/unfreeze_fs to avoid a confusion.

[PATCH 2/10]-[PATCH 6/10] Fix error handling in write_super_lockfs/unlockfs
                          (ext3, ext4, xfs, gfs2, jfs)
  Changed write_super_lockfs so that it returns an error if needed.
  unlockfs always returns 0.

[PATCH 7/10] reiserfs: Fix error handling in write_super_lockfs/unlockfs
  Changed write_super_lockfs/unlockfs so that they always return
  0 (success) to keep a current behavior.

[PATCH 8/10] Implement generic freeze feature
  The ioctls for the generic freeze feature are below.
  o Freeze the filesystem
    int ioctl(int fd, int FIFREEZE, arg)
      fd: The file descriptor of the mountpoint
      FIFREEZE: request code for the freeze
      arg: Ignored
      Return value: 0 if the operation succeeds. Otherwise, -1

  o Unfreeze the filesystem
    int ioctl(int fd, int FITHAW, arg)
      fd: The file descriptor of the mountpoint
      FITHAW: request code for unfreeze
      arg: Ignored
      Return value: 0 if the operation succeeds. Otherwise, -1

[PATCH 9/10] Remove XFS specific ioctl interfaces for freeze feature
  It removes XFS specific ioctl interfaces and request codes
  for freeze feature.
  This patch has been supplied by David Chinner.

[PATCH 10/10] Add timeout feature
  The timeout feature is added to "freeze ioctl" to solve a deadlock
  when the freezer accesses a frozen filesystem. And new ioctl
  to reset the timeout period is added to extend the timeout period.
  For example, the freezer resets the timeout period to 10 seconds every 5
  seconds.  In this approach, even if the freezer causes a deadlock by
  accessing the frozen filesystem, it will be solved by the timeout
  in 10 seconds and the freezer will be able to recognize that
  at the next reset of timeout period.
  o Freeze the filesystem
    int ioctl(int fd, int FIFREEZE, long *timeout_sec)
      fd: The file descriptor of the mountpoint
      FIFREEZE: request code for the freeze
      timeout_sec: the timeout period in seconds
               If it's 0 or 1, the timeout isn't set.
               This special case of "1" is implemented to keep
               the compatibility with XFS applications.
      Return value: 0 if the operation succeeds. Otherwise, -1

  o Reset the timeout period
    This is useful for the application to set the timeout_sec more accurately.
    For example, the freezer resets the timeout_sec to 10 seconds every 5
    seconds.  In this approach, even if the freezer causes a deadlock
    by accessing the frozen filesystem, it will be solved by the timeout
    in 10 seconds and the freezer can recognize that at the next reset
    of timeout_sec.
    int ioctl(int fd, int FIFREEZE_RESET_TIMEOUT, long *timeout_sec)
      fd:file descriptor of mountpoint
      FIFREEZE_RESET_TIMEOUT: request code for reset of timeout period
      timeout_sec: new timeout period in seconds
      Return value: 0 if the operation succeeds. Otherwise, -1
      Error number: If the filesystem has already been unfrozen,
                    errno is set to EINVAL.

Any comments are very welcome.

Cheers, Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/10] freeze feature ver 1.13
  2008-09-26  8:56 [PATCH 0/10] freeze feature ver 1.13 Takashi Sato
@ 2008-09-26 10:48 ` Valdis.Kletnieks
  2008-09-26 21:26   ` Dave Kleikamp
  0 siblings, 1 reply; 3+ messages in thread
From: Valdis.Kletnieks @ 2008-09-26 10:48 UTC (permalink / raw)
  To: Takashi Sato
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel@vger.kernel.org,
	dm-devel@redhat.com, viro@ZenIV.linux.org.uk,
	linux-ext4@vger.kernel.org, xfs@oss.sgi.com,
	mtk.manpages@googlemail.com, axboe@kernel.dk,
	linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 2395 bytes --]

On Fri, 26 Sep 2008 17:56:52 +0900, Takashi Sato said:

> [PATCH 1/10] VFS: Fix error handling of write_super_lockfs/unlockfs
>   Changed the type of write_super_lockfs and unlockfs from "void"
>   to "int" so that they can return an error. 
>   Rename write_super_lockfs/unlockfs of the super block operation
>   freeze_fs/unfreeze_fs to avoid a confusion.
> 
> [PATCH 2/10]-[PATCH 6/10] Fix error handling in write_super_lockfs/unlockfs
>                           (ext3, ext4, xfs, gfs2, jfs)
>   Changed write_super_lockfs so that it returns an error if needed.
>   unlockfs always returns 0.
> 
> [PATCH 7/10] reiserfs: Fix error handling in write_super_lockfs/unlockfs
>   Changed write_super_lockfs/unlockfs so that they always return
>   0 (success) to keep a current behavior.
> 
> [PATCH 8/10] Implement generic freeze feature
>   The ioctls for the generic freeze feature are below.
>   o Freeze the filesystem
>     int ioctl(int fd, int FIFREEZE, arg)
>       fd: The file descriptor of the mountpoint
>       FIFREEZE: request code for the freeze
>       arg: Ignored
>       Return value: 0 if the operation succeeds. Otherwise, -1
> 
>   o Unfreeze the filesystem
>     int ioctl(int fd, int FITHAW, arg)
>       fd: The file descriptor of the mountpoint
>       FITHAW: request code for unfreeze
>       arg: Ignored
>       Return value: 0 if the operation succeeds. Otherwise, -1
> 
> [PATCH 9/10] Remove XFS specific ioctl interfaces for freeze feature
>   It removes XFS specific ioctl interfaces and request codes
>   for freeze feature.
>   This patch has been supplied by David Chinner.
> 
> [PATCH 10/10] Add timeout feature
>   The timeout feature is added to "freeze ioctl" to solve a deadlock
>   when the freezer accesses a frozen filesystem. And new ioctl
>   to reset the timeout period is added to extend the timeout period.
>   For example, the freezer resets the timeout period to 10 seconds every 5
>   seconds.  In this approach, even if the freezer causes a deadlock by
>   accessing the frozen filesystem, it will be solved by the timeout

Would it be a good idea to merge patch 10 into patch 8?   Otherwise, there's
two issues I can see:

1) A mostly theoretical problem if a bisect lands exactly on patch 9 it can
hit the deadlock.

2) The API at patch 8 and patch 10 differs, that's going to make testing through
a bisection of this patch series a pain.

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/10] freeze feature ver 1.13
  2008-09-26 10:48 ` Valdis.Kletnieks
@ 2008-09-26 21:26   ` Dave Kleikamp
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Kleikamp @ 2008-09-26 21:26 UTC (permalink / raw)
  To: Valdis.Kletnieks
  Cc: Takashi Sato, Andrew Morton, Christoph Hellwig,
	linux-fsdevel@vger.kernel.org, dm-devel@redhat.com,
	viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org,
	xfs@oss.sgi.com, mtk.manpages@googlemail.com, axboe@kernel.dk,
	linux-kernel@vger.kernel.org

On Fri, 2008-09-26 at 06:48 -0400, Valdis.Kletnieks@vt.edu wrote:
> On Fri, 26 Sep 2008 17:56:52 +0900, Takashi Sato said:

> Would it be a good idea to merge patch 10 into patch 8?   Otherwise, there's
> two issues I can see:
> 
> 1) A mostly theoretical problem if a bisect lands exactly on patch 9 it can
> hit the deadlock.

Really, there's no deadlock until someone uses the new function, so
that's not really an issue, is it?  However, this patchset breaks
bisection anyway.

A bisect anywhere between patch 1 and 7 will cause some number of
filesystems to fail to compile.  Patches 1-7 either need to be combined
into one, or patch 1 needs to add freeze_fs and unfreeze_fs while
leaving write_super_lockfs and unlockfs, then a patch between 7 and 8
could remove write_super_lockfs and unlockfs.

> 2) The API at patch 8 and patch 10 differs, that's going to make testing through
> a bisection of this patch series a pain.

There's no need to test the new interface during a bisection.  Bisection
is important in testing regressions, but not new function.
-- 
David Kleikamp
IBM Linux Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-26 21:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-26  8:56 [PATCH 0/10] freeze feature ver 1.13 Takashi Sato
2008-09-26 10:48 ` Valdis.Kletnieks
2008-09-26 21:26   ` Dave Kleikamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox