cluster: RHEL6 - libgfs2: patch to update gfs1 superblock correctly

Abhijith Das adas at fedoraproject.org
Wed Mar 26 03:13:59 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=1c5332f5ac6c719b1a4b64a8940925a8a15c0029
Commit:        1c5332f5ac6c719b1a4b64a8940925a8a15c0029
Parent:        cbbe13ce1fafe0ecd9adb01473825f78da7291f2
Author:        Abhi Das <adas at redhat.com>
AuthorDate:    Tue Mar 25 22:07:28 2014 -0500
Committer:     Abhi Das <adas at redhat.com>
CommitterDate: Tue Mar 25 22:07:28 2014 -0500

libgfs2: patch to update gfs1 superblock correctly

gfs2-utils uses the gfs2_sb structure as a template to operate on
both gfs1 and gfs2 superblocks. Some fields of the gfs1 superblock
are not in gfs2 and are replaced by padded fields. These padded
fields were not being written out after modification and were
instead being zeroed out, thereby causing corruption.
This patch fixes gfs2_sb_out() to write out the padded fields.

Resolves: rhbz#1053668
Signed-off-by: Abhi Das <adas at redhat.com>
---
 gfs2/libgfs2/ondisk.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index e43cd26..b2f2ffd 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -125,15 +125,20 @@ void gfs2_sb_out(struct gfs2_sb *sb, struct gfs2_buffer_head *bh)
 
 	CPOUT_32(sb, str, sb_fs_format);
 	CPOUT_32(sb, str, sb_multihost_format);
+	CPOUT_32(sb, str, __pad0);                        /* gfs sb_flags */
 
 	CPOUT_32(sb, str, sb_bsize);
 	CPOUT_32(sb, str, sb_bsize_shift);
+	CPOUT_32(sb, str, __pad1);                        /* gfs sb_seg_size */
 
 	gfs2_inum_out(&sb->sb_master_dir, (char *)&str->sb_master_dir);
 	gfs2_inum_out(&sb->sb_root_dir, (char *)&str->sb_root_dir);
 
 	CPOUT_08(sb, str, sb_lockproto, GFS2_LOCKNAME_LEN);
 	CPOUT_08(sb, str, sb_locktable, GFS2_LOCKNAME_LEN);
+	gfs2_inum_out(&sb->__pad2, (char *)&str->__pad2); /* gfs rindex */
+	gfs2_inum_out(&sb->__pad3, (char *)&str->__pad3); /* gfs quota */
+	gfs2_inum_out(&sb->__pad4, (char *)&str->__pad4); /* gfs license */
 #ifdef GFS2_HAS_UUID
 	memcpy(str->sb_uuid, sb->sb_uuid, 16);
 #endif


More information about the cluster-commits mailing list