From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 1/2] libgfs2: patch to update gfs1 superblock correctly
Date: Wed, 12 Mar 2014 15:10:54 +0000 [thread overview]
Message-ID: <532078FE.9020900@redhat.com> (raw)
In-Reply-To: <1394597673-27787-2-git-send-email-adas@redhat.com>
Hi Abhi,
On 12/03/14 04:14, Abhi Das wrote:
> 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@redhat.com>
I'll defer to Bob's comments on patch #2 but this one looks good, thanks.
Cheers,
Andy
> ---
> gfs2/libgfs2/ondisk.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
> index dcc537e..3fbc63f 100644
> --- a/gfs2/libgfs2/ondisk.c
> +++ b/gfs2/libgfs2/ondisk.c
> @@ -132,15 +132,20 @@ void gfs2_sb_out(const struct gfs2_sb *sb, char *buf)
>
> 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
>
next prev parent reply other threads:[~2014-03-12 15:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 4:14 [Cluster-devel] [PATCH 0/2] gfs1 convert/fsck fixes Abhi Das
2014-03-12 4:14 ` [Cluster-devel] [PATCH 1/2] libgfs2: patch to update gfs1 superblock correctly Abhi Das
2014-03-12 15:10 ` Andrew Price [this message]
2014-03-12 4:14 ` [Cluster-devel] [PATCH 2/2] gfs2-utils: check and fix bad dinode pointers in gfs1 sb Abhi Das
2014-03-12 12:35 ` Bob Peterson
2014-03-12 17:47 ` Abhijith Das
2014-03-13 7:07 ` [Cluster-devel] [PATCHv2 " Abhijith Das
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=532078FE.9020900@redhat.com \
--to=anprice@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.