aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-11-01 09:57:57 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-06 08:59:16 -0500
commit4a221953ed121692aa25998451a57c7f4be8b4f6 (patch)
tree28361de426beea85a97812293841d1f28a9e4a67 /fs/gfs2
parenteb1dc33aa235b0e44ada6716cda385883c6e6bff (diff)
[GFS2] Fix incorrect fs sync behaviour.
This adds a sync_fs superblock operation for GFS2 and removes the journal flush from write_super in favour of sync_fs where it ought to be. This is more or less identical to the way in which ext3 does this. This bug was pointed out by Russell Cattelan <cattelan@redhat.com> Cc: Russell Cattelan <cattelan@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/ops_super.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/fs/gfs2/ops_super.c b/fs/gfs2/ops_super.c
index 06f06f7773d0..b47d9598c047 100644
--- a/fs/gfs2/ops_super.c
+++ b/fs/gfs2/ops_super.c
@@ -138,16 +138,27 @@ static void gfs2_put_super(struct super_block *sb)
138} 138}
139 139
140/** 140/**
141 * gfs2_write_super - disk commit all incore transactions 141 * gfs2_write_super
142 * @sb: the filesystem 142 * @sb: the superblock
143 * 143 *
144 * This function is called every time sync(2) is called.
145 * After this exits, all dirty buffers are synced.
146 */ 144 */
147 145
148static void gfs2_write_super(struct super_block *sb) 146static void gfs2_write_super(struct super_block *sb)
149{ 147{
148 sb->s_dirt = 0;
149}
150
151/**
152 * gfs2_sync_fs - sync the filesystem
153 * @sb: the superblock
154 *
155 * Flushes the log to disk.
156 */
157static int gfs2_sync_fs(struct super_block *sb, int wait)
158{
159 sb->s_dirt = 0;
150 gfs2_log_flush(sb->s_fs_info, NULL); 160 gfs2_log_flush(sb->s_fs_info, NULL);
161 return 0;
151} 162}
152 163
153/** 164/**
@@ -452,17 +463,18 @@ static void gfs2_destroy_inode(struct inode *inode)
452} 463}
453 464
454struct super_operations gfs2_super_ops = { 465struct super_operations gfs2_super_ops = {
455 .alloc_inode = gfs2_alloc_inode, 466 .alloc_inode = gfs2_alloc_inode,
456 .destroy_inode = gfs2_destroy_inode, 467 .destroy_inode = gfs2_destroy_inode,
457 .write_inode = gfs2_write_inode, 468 .write_inode = gfs2_write_inode,
458 .delete_inode = gfs2_delete_inode, 469 .delete_inode = gfs2_delete_inode,
459 .put_super = gfs2_put_super, 470 .put_super = gfs2_put_super,
460 .write_super = gfs2_write_super, 471 .write_super = gfs2_write_super,
461 .write_super_lockfs = gfs2_write_super_lockfs, 472 .sync_fs = gfs2_sync_fs,
462 .unlockfs = gfs2_unlockfs, 473 .write_super_lockfs = gfs2_write_super_lockfs,
463 .statfs = gfs2_statfs, 474 .unlockfs = gfs2_unlockfs,
464 .remount_fs = gfs2_remount_fs, 475 .statfs = gfs2_statfs,
465 .clear_inode = gfs2_clear_inode, 476 .remount_fs = gfs2_remount_fs,
466 .show_options = gfs2_show_options, 477 .clear_inode = gfs2_clear_inode,
478 .show_options = gfs2_show_options,
467}; 479};
468 480