Permalink
Browse files

FS/EXT4: make e2fsck recover a compile time option

from HTC vivid ICS source
  • Loading branch information...
1 parent 898f5ba commit a99905e5e293aea46c5ecb516f2e996df181f64a @faux123 committed Mar 30, 2012
Showing with 15 additions and 0 deletions.
  1. +5 −0 fs/ext4/Kconfig
  2. +4 −0 fs/ext4/ext4.h
  3. +6 −0 fs/ext4/super.c
View
5 fs/ext4/Kconfig
@@ -83,3 +83,8 @@ config EXT4_DEBUG
If you select Y here, then you will be able to turn on debugging
with a command such as "echo 1 > /sys/kernel/debug/ext4/mballoc-debug"
+
+config EXT4_E2FSCK_RECOVER
+ bool "EXT4 e2fsck recovery support"
+ depends on EXT4_FS
+ default n
View
4 fs/ext4/ext4.h
@@ -1216,9 +1216,11 @@ struct ext4_sb_info {
/* Kernel thread for multiple mount protection */
struct task_struct *s_mmp_tsk;
+#ifdef CONFIG_EXT4_E2FSCK_RECOVER
/* workqueue for rebooting oem-22 to run e2fsck */
struct work_struct reboot_work;
struct workqueue_struct *recover_wq;
+#endif
};
static inline struct ext4_sb_info *EXT4_SB(struct super_block *sb)
@@ -2182,7 +2184,9 @@ extern int ext4_move_extents(struct file *o_filp, struct file *d_filp,
__u64 start_orig, __u64 start_donor,
__u64 len, __u64 *moved_len);
+#ifdef CONFIG_EXT4_E2FSCK_RECOVER
extern void ext4_e2fsck(struct super_block *sb);
+#endif
/* page-io.c */
extern int __init ext4_init_pageio(void);
View
6 fs/ext4/super.c
@@ -43,7 +43,9 @@
#include <linux/kthread.h>
#include <linux/freezer.h>
+#ifdef CONFIG_EXT4_E2FSCK_RECOVER
#include <linux/reboot.h>
+#endif
#include "ext4.h"
#include "ext4_jbd2.h"
@@ -421,8 +423,10 @@ static void ext4_handle_error(struct super_block *sb)
panic("EXT4-fs (device %s): panic forced after error\n",
sb->s_id);
+#ifdef CONFIG_EXT4_E2FSCK_RECOVER
if (test_opt(sb, ERRORS_RO))
ext4_e2fsck(sb);
+#endif
}
void __ext4_error(struct super_block *sb, const char *function,
@@ -441,6 +445,7 @@ void __ext4_error(struct super_block *sb, const char *function,
ext4_handle_error(sb);
}
+#ifdef CONFIG_EXT4_E2FSCK_RECOVER
static void ext4_reboot(struct work_struct *work)
{
printk(KERN_ERR "%s: reboot to run e2fsck\n", __func__);
@@ -474,6 +479,7 @@ void ext4_e2fsck(struct super_block *sb)
/* queue the work to reboot */
queue_work(wq, &sb_info->reboot_work);
}
+#endif
void ext4_error_inode(struct inode *inode, const char *function,
unsigned int line, ext4_fsblk_t block,

0 comments on commit a99905e

Please sign in to comment.