remarkable-linux/fs/xfs
Takashi Sato c4be0c1dc4 filesystem freeze: add error handling of write_super_lockfs/unlockfs
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.

This patch:

VFS:
Changed the type of write_super_lockfs and unlockfs from "void"
to "int" so that they can return an error.
Rename write_super_lockfs and unlockfs of the super block operation
freeze_fs and unfreeze_fs to avoid a confusion.

ext3, ext4, xfs, gfs2, jfs:
Changed the type of write_super_lockfs and unlockfs from "void"
to "int" so that write_super_lockfs returns an error if needed,
and unlockfs always returns 0.

reiserfs:
Changed the type of write_super_lockfs and unlockfs from "void"
to "int" so that they always return 0 (success) to keep a current behavior.

Signed-off-by: Takashi Sato <t-sato@yk.jp.nec.com>
Signed-off-by: Masayuki Hamaguchi <m-hamaguchi@ys.jp.nec.com>
Cc: <xfs-masters@oss.sgi.com>
Cc: <linux-ext4@vger.kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-09 16:54:42 -08:00
..
linux-2.6 filesystem freeze: add error handling of write_super_lockfs/unlockfs 2009-01-09 16:54:42 -08:00
quota no explicit xfs_iflush for special inodes during unmount 2008-12-04 15:39:23 +11:00
support [XFS] avoid memory allocations in xfs_fs_vcmn_err 2008-12-22 18:02:01 +11:00
Kconfig
Makefile move inode tracing out of xfs_vnode. 2008-12-04 15:39:25 +11:00
xfs.h [XFS] make btree tracing generic 2008-10-30 16:55:13 +11:00
xfs_acl.c CRED: Wrap task credential accesses in the XFS filesystem 2008-11-14 10:39:04 +11:00
xfs_acl.h [XFS] kill bhv_vnode_t 2008-08-13 16:22:40 +10:00
xfs_ag.h [XFS] factor out xfs_read_agf helper 2008-12-01 11:37:20 +11:00
xfs_alloc.c [XFS] factor out xfs_read_agf helper 2008-12-01 11:37:20 +11:00
xfs_alloc.h [XFS] Sync up kernel and user-space headers 2008-10-30 17:05:38 +11:00
xfs_alloc_btree.c [XFS] Always use struct xfs_btree_block instead of short / longform 2008-10-30 17:14:34 +11:00
xfs_alloc_btree.h [XFS] Always use struct xfs_btree_block instead of short / longform 2008-10-30 17:14:34 +11:00
xfs_arch.h [XFS] Sync up kernel and user-space headers 2008-10-30 17:05:38 +11:00
xfs_attr.c [XFS] Move xfs_attr_rolltrans to xfs_trans_roll 2008-08-13 16:05:49 +10:00
xfs_attr.h [XFS] Move attr log alloc size calculator to another function. 2008-08-13 16:03:35 +10:00
xfs_attr_leaf.c [XFS] Move xfs_attr_rolltrans to xfs_trans_roll 2008-08-13 16:05:49 +10:00
xfs_attr_leaf.h [XFS] Move xfs_attr_rolltrans to xfs_trans_roll 2008-08-13 16:05:49 +10:00
xfs_attr_sf.h [XFS] 2008-07-28 16:58:35 +10:00
xfs_bit.c [XFS] Use the generic bitops rather than implementing them ourselves. 2008-08-13 15:41:12 +10:00
xfs_bit.h [XFS] Sync up kernel and user-space headers 2008-10-30 17:05:38 +11:00
xfs_bmap.c [XFS] Add new getbmap flags. 2008-12-01 11:29:28 +11:00
xfs_bmap.h [XFS] convert xfs_getbmap to take formatter functions 2008-12-01 11:29:00 +11:00
xfs_bmap_btree.c [XFS] handle unaligned data in xfs_bmbt_disk_get_all 2008-12-23 11:54:46 +11:00
xfs_bmap_btree.h [XFS] Move XFS_BMAP_SANITY_CHECK out of line. 2008-10-30 17:14:43 +11:00
xfs_btree.c [XFS] Always use struct xfs_btree_block instead of short / longform 2008-10-30 17:14:34 +11:00
xfs_btree.h [XFS] Always use struct xfs_btree_block instead of short / longform 2008-10-30 17:14:34 +11:00
xfs_btree_trace.c [XFS] make btree tracing generic 2008-10-30 16:58:50 +11:00
xfs_btree_trace.h [XFS] make btree tracing generic 2008-10-30 16:58:50 +11:00
xfs_buf_item.c [XFS] Remove XFS_BUF_SHUT() and friends 2008-12-22 17:52:58 +11:00
xfs_buf_item.h
xfs_da_btree.c [XFS] Account for allocated blocks when expanding directories 2008-11-10 17:51:14 +11:00
xfs_da_btree.h [XFS] Sync up kernel and user-space headers 2008-10-30 17:05:38 +11:00
xfs_dfrag.c [XFS] Move copy_from_user calls out of ioctl helpers into ioctl switch. 2008-12-02 17:08:01 +11:00
xfs_dfrag.h [XFS] Move copy_from_user calls out of ioctl helpers into ioctl switch. 2008-12-02 17:08:01 +11:00
xfs_dinode.h [XFS] kill XFS_DINODE_VERSION_ defines 2008-12-01 11:37:42 +11:00
xfs_dir2.c [XFS] Account for allocated blocks when expanding directories 2008-11-10 17:51:14 +11:00
xfs_dir2.h [XFS] Return case-insensitive match for dentry cache 2008-07-28 16:58:40 +10:00
xfs_dir2_block.c [XFS] Return case-insensitive match for dentry cache 2008-07-28 16:58:40 +10:00
xfs_dir2_block.h
xfs_dir2_data.c [XFS] Name operation vector for hash and compare 2008-07-28 16:58:36 +10:00
xfs_dir2_data.h
xfs_dir2_leaf.c [XFS] Fix CI lookup in leaf-form directories 2008-07-28 16:59:06 +10:00
xfs_dir2_leaf.h
xfs_dir2_node.c [XFS] Fix returning case-preserved name with CI node form directories 2008-07-28 16:59:01 +10:00
xfs_dir2_node.h
xfs_dir2_sf.c [XFS] Return case-insensitive match for dentry cache 2008-07-28 16:58:40 +10:00
xfs_dir2_sf.h [XFS] kill xfs_dinode_core_t 2008-12-01 11:37:35 +11:00
xfs_dir2_trace.c [XFS] Add op_flags field and helpers to xfs_da_args 2008-07-28 16:58:37 +10:00
xfs_dir2_trace.h
xfs_dmapi.h removed unused #include <linux/version.h>'s 2008-08-23 12:14:12 -07:00
xfs_dmops.c [XFS] kill struct xfs_mount_args 2008-10-30 17:53:24 +11:00
xfs_error.c [XFS] avoid memory allocations in xfs_fs_vcmn_err 2008-12-22 18:02:01 +11:00
xfs_error.h [XFS] avoid memory allocations in xfs_fs_vcmn_err 2008-12-22 18:02:01 +11:00
xfs_extfree_item.c [XFS] Finish removing the mount pointer from the AIL API 2008-10-30 17:39:58 +11:00
xfs_extfree_item.h
xfs_filestream.c [XFS] Use KM_NOFS for debug trace buffers 2008-08-13 16:51:57 +10:00
xfs_filestream.h
xfs_fs.h [XFS] Move compat ioctl structs & numbers into xfs_ioctl32.h 2008-12-02 17:08:44 +11:00
xfs_fsops.c filesystem freeze: add error handling of write_super_lockfs/unlockfs 2009-01-09 16:54:42 -08:00
xfs_fsops.h filesystem freeze: add error handling of write_super_lockfs/unlockfs 2009-01-09 16:54:42 -08:00
xfs_ialloc.c [XFS] kill the XFS_IMAP_BULKSTAT flag 2008-12-01 11:38:13 +11:00
xfs_ialloc.h [XFS] merge xfs_imap into xfs_dilocate 2008-12-01 11:38:03 +11:00
xfs_ialloc_btree.c [XFS] Always use struct xfs_btree_block instead of short / longform 2008-10-30 17:14:34 +11:00
xfs_ialloc_btree.h [XFS] Always use struct xfs_btree_block instead of short / longform 2008-10-30 17:14:34 +11:00
xfs_iget.c move inode tracing out of xfs_vnode. 2008-12-04 15:39:25 +11:00
xfs_inode.c [XFS] Remove XFS_BUF_SHUT() and friends 2008-12-22 17:52:58 +11:00
xfs_inode.h [XFS] Fix merge failures 2008-12-29 16:47:18 +11:00
xfs_inode_item.c [XFS] embededd struct xfs_imap into xfs_inode 2008-12-01 11:38:08 +11:00
xfs_inode_item.h [XFS] Sync up kernel and user-space headers 2008-10-30 17:05:38 +11:00
xfs_inum.h
xfs_iomap.c [XFS] Fix speculative allocation beyond eof 2008-12-22 17:56:49 +11:00
xfs_iomap.h
xfs_itable.c [XFS] Fix xfs_bulkstat_one size checks & error handling 2008-12-02 17:16:03 +11:00
xfs_itable.h [XFS] Fix xfs_bulkstat_one size checks & error handling 2008-12-02 17:16:03 +11:00
xfs_log.c reduce l_icloglock roundtrips 2008-12-04 15:39:21 +11:00
xfs_log.h [XFS] Fix double free of log tickets 2008-11-17 17:37:10 +11:00
xfs_log_priv.h [XFS] sanitize xlog_in_core_t definition 2008-12-01 11:37:25 +11:00
xfs_log_recover.c [XFS] replace b_fspriv with b_mount 2008-12-11 13:13:33 +11:00
xfs_log_recover.h
xfs_mount.c kill xfs_unmount_flush 2008-12-04 15:39:24 +11:00
xfs_mount.h [XFS] resync headers with libxfs 2008-12-11 13:14:17 +11:00
xfs_mru_cache.c [XFS] streamline init/exit path 2008-07-28 16:59:25 +10:00
xfs_mru_cache.h
xfs_qmops.c [XFS] kill struct xfs_mount_args 2008-10-30 17:53:24 +11:00
xfs_quota.h kill dead quota flags 2008-12-04 15:39:22 +11:00
xfs_refcache.h
xfs_rename.c [XFS] simplify projid check in xfs_rename 2008-12-11 13:13:52 +11:00
xfs_rtalloc.c [XFS] Move copy_from_user calls out of ioctl helpers into ioctl switch. 2008-12-02 17:08:01 +11:00
xfs_rtalloc.h
xfs_rw.c [XFS] replace b_fspriv with b_mount 2008-12-11 13:13:33 +11:00
xfs_rw.h
xfs_sb.h [XFS] resync headers with libxfs 2008-12-11 13:14:17 +11:00
xfs_trans.c [XFS] Fix double free of log tickets 2008-11-17 17:37:10 +11:00
xfs_trans.h [XFS] Finish removing the mount pointer from the AIL API 2008-10-30 17:39:58 +11:00
xfs_trans_ail.c [XFS] correctly select first log item to push 2008-10-30 18:26:51 +11:00
xfs_trans_buf.c [XFS] Finish removing the mount pointer from the AIL API 2008-10-30 17:39:58 +11:00
xfs_trans_extfree.c
xfs_trans_inode.c use xfs_trans_ijoin in xfs_trans_iget 2008-12-04 15:39:23 +11:00
xfs_trans_item.c [XFS] Add ail pointer into log items 2008-10-30 17:39:46 +11:00
xfs_trans_priv.h [XFS] Finish removing the mount pointer from the AIL API 2008-10-30 17:39:58 +11:00
xfs_trans_space.h
xfs_types.h
xfs_utils.c [XFS] kill XFS_DINODE_VERSION_ defines 2008-12-01 11:37:42 +11:00
xfs_utils.h [XFS] implement IHOLD/IRELE directly 2008-08-13 16:13:45 +10:00
xfs_vnodeops.c [XFS] use inode_change_ok for setattr permission checking 2008-12-11 13:15:10 +11:00
xfs_vnodeops.h [XFS] Fix merge failures 2008-12-29 16:47:18 +11:00