gfs2: Fix freeze sysfs interface
Andreas Gruenbacher
maintainerPATCH 1/1 gfs2: Fix freeze sysfs interface
According to commit d564053f0746 ("GFS2: Clean up freeze code"), the freeze sysfs attribute is supposed to behave in the same way as the FIFREEZE / FITHAW ioctls. This broke in commit 2e60d7683c8d ("GFS2:
update freeze code to use freeze/thaw_super on all nodes") when the gfs2_freeze_super and gfs2_thaw_super operations were added. Since then, the freeze sysfs attribute was performing local instead of cluster-wide freeze / thaw operations. Fix that by calling the filesystem-specific operations.
Fixes 2e60d7683c8d ("GFS2: update freeze code to use freeze/thaw_super on all nodes")
Signed-off-by Andreas Gruenbacher <[email protected]>
fs/gfs2/super.c +4 -4
@@ -727,8 +727,8 @@ void gfs2_freeze_func(struct work_struct *work)* */ -static int gfs2_freeze_super (struct super_block *sb,enum freeze_holder who, -const void *freeze_owner) +int gfs2_freeze_super (struct super_block *sb,enum freeze_holder who, +const void *freeze_owner) {struct gfs2_sbd *sdp = sb->s_fs_info;int error;
@@ -796,8 +796,8 @@ static int gfs2_freeze_fs(struct super_block *sb)* */ -static int gfs2_thaw_super (struct super_block *sb,enum freeze_holder who, -const void *freeze_owner) +int gfs2_thaw_super (struct super_block *sb,enum freeze_holder who, +const void *freeze_owner) {struct gfs2_sbd *sdp = sb->s_fs_info;int error;
fs/gfs2/super.h +4 -0
@@ -35,6 +35,10 @@ int gfs2_lookup_in_master_dir(struct gfs2_sbd *sdp, char *filename,int gfs2_make_fs_rw (struct gfs2_sbd *sdp);void gfs2_make_fs_ro (struct gfs2_sbd *sdp); +int gfs2_freeze_super (struct super_block *sb,enum freeze_holder who, +const void *freeze_owner); +int gfs2_thaw_super (struct super_block *sb,enum freeze_holder who, +const void *freeze_owner);void gfs2_online_uevent (struct gfs2_sbd *sdp);void gfs2_destroy_threads (struct gfs2_sbd *sdp);int gfs2_statfs_init (struct gfs2_sbd *sdp);
fs/gfs2/sys.c +4 -2
@@ -164,10 +164,12 @@ static ssize_t freeze_store(struct gfs2_sbd *sdp, const char *buf, size_t len)switch (n) {case 0 : - error =thaw_super (sdp->sd_vfs,FREEZE_HOLDER_USERSPACE ,NULL ); + error =gfs2_thaw_super (sdp->sd_vfs,FREEZE_HOLDER_USERSPACE , +NULL );break ;case 1 : - error =freeze_super (sdp->sd_vfs,FREEZE_HOLDER_USERSPACE ,NULL ); + error =gfs2_freeze_super (sdp->sd_vfs,FREEZE_HOLDER_USERSPACE , +NULL );break ;default :return -EINVAL ;