summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Robinson <pbrobinson@gmail.com>2015-08-21 10:07:15 +0100
committerPeter Robinson <pbrobinson@gmail.com>2015-08-21 10:07:15 +0100
commit7cb2263fc3ceef00a2037cc367daf2169c8337ee (patch)
tree947d289197f6f01da24d9a4cf32c45802b0d6b54
parentb79611b13a5425233a5ea62a1d2e2b4825d9e81f (diff)
parent16b395303fe0c20a44f4c4c901e56d8954434e3f (diff)
downloadkernel-7cb2263fc3ceef00a2037cc367daf2169c8337ee.tar.gz
kernel-7cb2263fc3ceef00a2037cc367daf2169c8337ee.tar.xz
kernel-7cb2263fc3ceef00a2037cc367daf2169c8337ee.zip
Merge branch 'master' of ssh://pkgs.fedoraproject.org/kernel
-rw-r--r--ext4-dont-manipulate-recovery-flag-when-freezing.patch66
-rw-r--r--kernel.spec6
2 files changed, 72 insertions, 0 deletions
diff --git a/ext4-dont-manipulate-recovery-flag-when-freezing.patch b/ext4-dont-manipulate-recovery-flag-when-freezing.patch
new file mode 100644
index 000000000..0dbf21b52
--- /dev/null
+++ b/ext4-dont-manipulate-recovery-flag-when-freezing.patch
@@ -0,0 +1,66 @@
+From: Eric Sandeen <sandeen@xxxxxxxxxx>
+Date: Wed, 05 Aug 2015 15:13:58 -0700
+Subject: [PATCH] ext4: don't manipulate recovery flag when freezing no-journal fs
+
+At some point along this sequence of changes:
+
+f6e63f9 ext4: fold ext4_nojournal_sops into ext4_sops
+bb04457 ext4: support freezing ext2 (nojournal) file systems
+9ca9238 ext4: Use separate super_operations structure for no_journal filesystems
+
+ext4 started setting needs_recovery on filesystems without journals
+when they are unfrozen. This makes no sense, and in fact confuses
+blkid to the point where it doesn't recognize the filesystem at all.
+
+(freeze ext2; unfreeze ext2; run blkid; see no output; run dumpe2fs,
+see needs_recovery set on fs w/ no journal).
+
+To fix this, don't manipulate the INCOMPAT_RECOVER feature on
+filesystems without journals.
+
+Reported-by: Stu Mark <smark@xxxxxxxxx>
+Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
+---
+
+Note, is there a reason that in ext4_freeze, if journal_flush
+fails, we skip the ext4_commit_super call? I didn't change that
+here, but it seems odd.
+
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c
+index 58987b5..e7b345d 100644
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -4833,10 +4833,11 @@ static int ext4_freeze(struct super_block *sb)
+ error = jbd2_journal_flush(journal);
+ if (error < 0)
+ goto out;
++
++ /* Journal blocked and flushed, clear needs_recovery flag. */
++ EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
+ }
+
+- /* Journal blocked and flushed, clear needs_recovery flag. */
+- EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
+ error = ext4_commit_super(sb, 1);
+ out:
+ if (journal)
+@@ -4854,8 +4855,11 @@ static int ext4_unfreeze(struct super_block *sb)
+ if (sb->s_flags & MS_RDONLY)
+ return 0;
+
+- /* Reset the needs_recovery flag before the fs is unlocked. */
+- EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
++ if (EXT4_SB(sb)->s_journal) {
++ /* Reset the needs_recovery flag before the fs is unlocked. */
++ EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
++ }
++
+ ext4_commit_super(sb, 1);
+ return 0;
+ }
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
+the body of a message to majordomo@xxxxxxxxxxxxxxx
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+
diff --git a/kernel.spec b/kernel.spec
index c03e328ec..a36ee93c9 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -593,6 +593,9 @@ Patch509: ideapad-laptop-Add-Lenovo-Yoga-3-14-to-no_hw_rfkill-.patch
#rhbz 1253789
Patch510: iSCSI-let-session-recovery_tmo-sysfs-writes-persist.patch
+#rhbz 1250717
+Patch512: ext4-dont-manipulate-recovery-flag-when-freezing.patch
+
Patch904: kdbus.patch
# END OF PATCH DEFINITIONS
@@ -2030,6 +2033,9 @@ fi
#
#
%changelog
+* Thu Aug 20 2015 Josh Boyer <jwboyer@fedoraproject.org>
+- Fix incorrect ext4 freezing behavior on non-journaled fs (rhbz 1250717)
+
* Wed Aug 19 2015 Josh Boyer <jwboyer@fedoraproject.org> - 4.2.0-0.rc7.git2.1
- Linux v4.2-rc7-24-g1b647a166f07