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
commitc1c346db9ccb40149582eb5cfe4ed0e30cc0d967 (patch)
tree7eb8c03b01c641196b11aa74789bb93358dc03cf
parent4122b4dce4db192eecd2816822d60be6f046321f (diff)
ext4: make sure enough credits are reserved for dioread_nolock
writes (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.3-047-ext4-make-sure-enough-credits-are-reserved-for.patch50
-rw-r--r--series.conf1
2 files changed, 51 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-047-ext4-make-sure-enough-credits-are-reserved-for.patch b/patches.kernel.org/4.20.3-047-ext4-make-sure-enough-credits-are-reserved-for.patch
new file mode 100644
index 0000000000..454ddc9d7e
--- /dev/null
+++ b/patches.kernel.org/4.20.3-047-ext4-make-sure-enough-credits-are-reserved-for.patch
@@ -0,0 +1,50 @@
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Mon, 24 Dec 2018 20:27:08 -0500
+Subject: [PATCH] ext4: make sure enough credits are reserved for
+ dioread_nolock writes
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: 812c0cab2c0dfad977605dbadf9148490ca5d93f
+
+commit 812c0cab2c0dfad977605dbadf9148490ca5d93f upstream.
+
+There are enough credits reserved for most dioread_nolock writes;
+however, if the extent tree is sufficiently deep, and/or quota is
+enabled, the code was not allowing for all eventualities when
+reserving journal credits for the unwritten extent conversion.
+
+This problem can be seen using xfstests ext4/034:
+
+ WARNING: CPU: 1 PID: 257 at fs/ext4/ext4_jbd2.c:271 __ext4_handle_dirty_metadata+0x10c/0x180
+ Workqueue: ext4-rsv-conversion ext4_end_io_rsv_work
+ RIP: 0010:__ext4_handle_dirty_metadata+0x10c/0x180
+ ...
+ EXT4-fs: ext4_free_blocks:4938: aborting transaction: error 28 in __ext4_handle_dirty_metadata
+ EXT4: jbd2_journal_dirty_metadata failed: handle type 11 started at line 4921, credits 4/0, errcode -28
+ EXT4-fs error (device dm-1) in ext4_free_blocks:4950: error 28
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Cc: stable@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/ext4/inode.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
+index 9affabd07682..165ff331d998 100644
+--- a/fs/ext4/inode.c
++++ b/fs/ext4/inode.c
+@@ -2778,7 +2778,8 @@ static int ext4_writepages(struct address_space *mapping,
+ * We may need to convert up to one extent per block in
+ * the page and we may dirty the inode.
+ */
+- rsv_blocks = 1 + (PAGE_SIZE >> inode->i_blkbits);
++ rsv_blocks = 1 + ext4_chunk_trans_blocks(inode,
++ PAGE_SIZE >> inode->i_blkbits);
+ }
+
+ /*
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index c6269768bc..3e721ea149 100644
--- a/series.conf
+++ b/series.conf
@@ -284,6 +284,7 @@
patches.kernel.org/4.20.3-044-drm-amdgpu-Don-t-ignore-rc-from-drm_dp_mst_top.patch
patches.kernel.org/4.20.3-045-drm-amdgpu-Don-t-fail-resume-process-if-resumi.patch
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
########################################################
# Build fixes that apply to the vanilla kernel too.