Skip to contentSkip to conversation

ocfs2: avoid panic for local mounts on corruptions

PATCH New Srinivas Eeda 2 participants 2 messages Nov 23, 2009 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: avoid panic for local mounts on corruptions

When a file system is mounted local, it may be enough to remount it read only on seeing corruptions.

---
 fs/ocfs2/super.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
fs/ocfs2/super.c +6 -4
index a3f8871..c1ee5f0 100644
@@ -2487,10 +2487,12 @@ void __ocfs2_abort(struct super_block* sb,
 	 * TODO: This should abort the journal and alert other nodes
 	 * that our slot needs recovery. */
 
-	/* Force a panic(). This stinks, but it's better than letting
-	 * things continue without having a proper hard readonly
-	 * here. */
-	OCFS2_SB(sb)->s_mount_opt |= OCFS2_MOUNT_ERRORS_PANIC;
+	/* Force a panic() for clustered mounts. This stinks, but it's
+	 * better than letting things continue withouthaving a proper
+	 * hard readonly here.
+	 * */
+	if (!ocfs2_mount_local(OCFS2_SB(sb)))
+		OCFS2_SB(sb)->s_mount_opt |= OCFS2_MOUNT_ERRORS_PANIC;
 	ocfs2_handle_error(sb);
 }
 
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 ocfs2: avoid panic for local mounts on corruptions

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;h=a2f2ddbf2bafdbc7e4f3bbf09439b42c8fee2747

This change was pushed to mainline few months ago.

Quoted 30 lines · Srinivas Eeda

When a file system is mounted local, it may be enough to remount it read only on seeing corruptions.

---
 fs/ocfs2/super.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
fs/ocfs2/super.c +6 -4
index a3f8871..c1ee5f0 100644
@@ -2487,10 +2487,12 @@ void __ocfs2_abort(struct super_block* sb,
 	 * TODO: This should abort the journal and alert other nodes
 	 * that our slot needs recovery. */
 
-	/* Force a panic(). This stinks, but it's better than letting
-	 * things continue without having a proper hard readonly
-	 * here. */
-	OCFS2_SB(sb)->s_mount_opt |= OCFS2_MOUNT_ERRORS_PANIC;
+	/* Force a panic() for clustered mounts. This stinks, but it's
+	 * better than letting things continue withouthaving a proper
+	 * hard readonly here.
+	 * */
+	if (!ocfs2_mount_local(OCFS2_SB(sb)))
+		OCFS2_SB(sb)->s_mount_opt |= OCFS2_MOUNT_ERRORS_PANIC;
 	ocfs2_handle_error(sb);
 }