Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:27 +0100
committerJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:41 +0100
commit8eb3266aac8b7e87242decea5602a3e3700a91ca (patch)
treea54bab483119e4a5a1849a90d2f3c9fc5a5babf0
parent19c7d54a3a0dd539b7b479fc1953c44707b7bb01 (diff)
ext4: avoid kernel warning when writing the superblock to a
dead device (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.3-049-ext4-avoid-kernel-warning-when-writing-the-sup.patch48
-rw-r--r--series.conf1
2 files changed, 49 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-049-ext4-avoid-kernel-warning-when-writing-the-sup.patch b/patches.kernel.org/4.20.3-049-ext4-avoid-kernel-warning-when-writing-the-sup.patch
new file mode 100644
index 0000000000..f9fd63fcdf
--- /dev/null
+++ b/patches.kernel.org/4.20.3-049-ext4-avoid-kernel-warning-when-writing-the-sup.patch
@@ -0,0 +1,48 @@
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Sun, 30 Dec 2018 23:20:39 -0500
+Subject: [PATCH] ext4: avoid kernel warning when writing the superblock to a
+ dead device
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: e86807862e6880809f191c4cea7f88a489f0ed34
+
+commit e86807862e6880809f191c4cea7f88a489f0ed34 upstream.
+
+The xfstests generic/475 test switches the underlying device with
+dm-error while running a stress test. This results in a large number
+of file system errors, and since we can't lock the buffer head when
+marking the superblock dirty in the ext4_grp_locked_error() case, it's
+possible the superblock to be !buffer_uptodate() without
+buffer_write_io_error() being true.
+
+We need to set buffer_uptodate() before we call mark_buffer_dirty() or
+this will trigger a WARN_ON. It's safe to do this since the
+superblock must have been properly read into memory or the mount would
+have been successful. So if buffer_uptodate() is not set, we can
+safely assume that this happened due to a failed attempt to write the
+superblock.
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/ext4/super.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c
+index 6641a1b8a6a5..521320de2017 100644
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -4905,7 +4905,7 @@ static int ext4_commit_super(struct super_block *sb, int sync)
+ ext4_superblock_csum_set(sb);
+ if (sync)
+ lock_buffer(sbh);
+- if (buffer_write_io_error(sbh)) {
++ if (buffer_write_io_error(sbh) || !buffer_uptodate(sbh)) {
+ /*
+ * Oh, dear. A previous attempt to write the
+ * superblock failed. This could happen because the
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 9d1bcf1474..edc80f6e45 100644
--- a/series.conf
+++ b/series.conf
@@ -286,6 +286,7 @@
patches.kernel.org/4.20.3-046-rbd-don-t-return-0-on-unmap-if-RBD_DEV_FLAG_RE.patch
patches.kernel.org/4.20.3-047-ext4-make-sure-enough-credits-are-reserved-for.patch
patches.kernel.org/4.20.3-048-ext4-fix-a-potential-fiemap-page-fault-deadloc.patch
+ patches.kernel.org/4.20.3-049-ext4-avoid-kernel-warning-when-writing-the-sup.patch
########################################################
# Build fixes that apply to the vanilla kernel too.