From: Theodore Ts'o Date: Fri, 18 Mar 2016 20:07:34 +0000 (-0400) Subject: tune2fs: don't include journal recovery when building for Android X-Git-Tag: v1.43-WIP-2016-05-12~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c05bb9fbae9d31d4a0c0d52b5ecec8ebd1b9011;p=thirdparty%2Fe2fsprogs.git tune2fs: don't include journal recovery when building for Android Signed-off-by: Theodore Ts'o --- diff --git a/misc/Android.mk b/misc/Android.mk index d7a2ee109..55f2767e2 100644 --- a/misc/Android.mk +++ b/misc/Android.mk @@ -57,7 +57,7 @@ tune2fs_src_files := \ tune2fs_c_includes := \ external/e2fsprogs/e2fsck -tune2fs_cflags := -O2 -g -W -Wall +tune2fs_cflags := -O2 -g -W -Wall -DNO_RECOVERY tune2fs_shared_libraries := \ libext2fs \ diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 577623382..10ce58f50 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -3154,6 +3154,18 @@ retry_open: free(ext_mount_opts); } +#ifdef NO_RECOVERY + /* Warn if file system needs recovery and it is opened for writing. */ + if ((open_flag & EXT2_FLAG_RW) && !(mount_flags & EXT2_MF_MOUNTED) && + (sb->s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL) && + (sb->s_feature_incompat & EXT3_FEATURE_INCOMPAT_RECOVER)) { + fprintf(stderr, +_("Warning: The journal is dirty. You may wish to replay the journal like:\n\n" + "\te2fsck -E journal_only %s\n\n" + "then rerun this command. Otherwise, any changes made may be overwritten\n" + "by journal recovery.\n"), device_name); + } +#else /* Recover the journal if possible. */ if ((open_flag & EXT2_FLAG_RW) && !(mount_flags & EXT2_MF_MOUNTED) && ext2fs_has_feature_journal_needs_recovery(fs->super)) { @@ -3169,6 +3181,7 @@ retry_open: ext2fs_clear_feature_journal_needs_recovery(fs->super); ext2fs_mark_super_dirty(fs); } +#endif free(device_name); remove_error_table(&et_ext2_error_table);