Skip to contentSkip to conversation

bz 450156 - kernel panic mounting volume

PATCH New Bob Peterson 2 participants 2 messages Jun 9, 2008 – Jun 11, 2008 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bz 450156 - kernel panic mounting volume

Hi,

This patch fixes bugzilla bug 450156.

This started with a not-too-improbable mount failure because the locking protocol was never set back to its proper "lock_dlm" after the system was rebooted in the middle of a gfs2_fsck. That left a (purposely) invalid locking protocol in the superblock, which caused an error when the file system was mounted the next time.

When there's an error mounting, vfs calls DQUOT_OFF, which calls vfs_quota_off which calls gfs2_sync_fs. Next, gfs2_sync_fs calls gfs2_log_flush passing s_fs_info. But due to the error, s_fs_info had been previously set to NULL, and so we have the kernel oops.

My solution in this patch is to test for the NULL value before passing it. I tested this patch and it fixes the problem.

I believe the problem was caused due to changes in what the DQUOTA_OFF macro does in newer kernels. I could not recreate the problem on a RHEL kernel and don't believe this affects RHEL.

Regards,

Bob Peterson

--

 fs/gfs2/ops_super.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/gfs2/ops_super.c +1 -1
index 0b7cc92..6690792 100644
@@ -155,7 +155,7 @@ static void gfs2_write_super(struct super_block *sb)
 static int gfs2_sync_fs(struct super_block *sb, int wait)
 {
 	sb->s_dirt = 0;
-	if (wait)
+	if (wait && sb->s_fs_info)
 		gfs2_log_flush(sb->s_fs_info, NULL);
 	return 0;
 }
#1 lore raw

PATCH 1/1 bz 450156 - kernel panic mounting volume

Hi,

Now in the GFS2 -nmw git tree. Thanks,

Steve.

Quoted 46 lines · Bob Peterson

Hi,

This patch fixes bugzilla bug 450156.

This started with a not-too-improbable mount failure because the locking protocol was never set back to its proper "lock_dlm" after the system was rebooted in the middle of a gfs2_fsck. That left a (purposely) invalid locking protocol in the superblock, which caused an error when the file system was mounted the next time.

When there's an error mounting, vfs calls DQUOT_OFF, which calls vfs_quota_off which calls gfs2_sync_fs. Next, gfs2_sync_fs calls gfs2_log_flush passing s_fs_info. But due to the error, s_fs_info had been previously set to NULL, and so we have the kernel oops.

My solution in this patch is to test for the NULL value before passing it. I tested this patch and it fixes the problem.

I believe the problem was caused due to changes in what the DQUOTA_OFF macro does in newer kernels. I could not recreate the problem on a RHEL kernel and don't believe this affects RHEL.

Regards,

Bob Peterson

--

 fs/gfs2/ops_super.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/gfs2/ops_super.c +1 -1
index 0b7cc92..6690792 100644
@@ -155,7 +155,7 @@ static void gfs2_write_super(struct super_block *sb)
 static int gfs2_sync_fs(struct super_block *sb, int wait)
 {
 	sb->s_dirt = 0;
-	if (wait)
+	if (wait && sb->s_fs_info)
 		gfs2_log_flush(sb->s_fs_info, NULL);
 	return 0;
 }