summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.SRCINFO2
-rwxr-xr-xPKGBUILD4
-rw-r--r--ext4-corruption-patch.patch21
3 files changed, 26 insertions, 1 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 45df342d745f..0c768cff1aa0 100755
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -19,6 +19,7 @@ pkgbase = linux-bcachefs-git
source = 60-linux.hook
source = 90-linux.hook
source = linux.preset
+ source = ext4-corruption-patch.patch
validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886
validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E
sha256sums = SKIP
@@ -27,6 +28,7 @@ pkgbase = linux-bcachefs-git
sha256sums = ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21
sha256sums = c043f3033bb781e2688794a59f6d1f7ed49ef9b13eb77ff9a425df33a244a636
sha256sums = ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65
+ sha256sums = e0048bd7c614b3f31adba295b67263df0e7859a1587fac614df266a204b154f9
pkgname = linux-bcachefs-git
pkgdesc = The Linux-bcachefs-git kernel and modules
diff --git a/PKGBUILD b/PKGBUILD
index 6bf09fa84162..b28d0aa57b7f 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -41,6 +41,7 @@ source=(
60-linux.hook # pacman hook for depmod
90-linux.hook # pacman hook for initramfs regeneration
linux.preset # standard config files for mkinitcpio ramdisk
+ ext4-corruption-patch.patch
)
validpgpkeys=(
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
@@ -51,7 +52,8 @@ sha256sums=('SKIP'
'66bb9855500368f9fe2c29cf2cdc2660dff376f80eae8786691da95cf50fe6dc'
'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
'c043f3033bb781e2688794a59f6d1f7ed49ef9b13eb77ff9a425df33a244a636'
- 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65')
+ 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
+ 'e0048bd7c614b3f31adba295b67263df0e7859a1587fac614df266a204b154f9')
_kernelname=${pkgbase#linux}
: ${_kernelname:=-ARCH}
diff --git a/ext4-corruption-patch.patch b/ext4-corruption-patch.patch
new file mode 100644
index 000000000000..aa7f72653a7b
--- /dev/null
+++ b/ext4-corruption-patch.patch
@@ -0,0 +1,21 @@
+@@ -, +, @@
+ https://bugzilla.kernel.org/show_bug.cgi?id=201685
+---
+--- a/block/blk-mq.c
++++ a/block/blk-mq.c
+@@ -1715,6 +1715,15 @@ static blk_status_t __blk_mq_issue_directly(struct blk_mq_hw_ctx *hctx,
+ break;
+ case BLK_STS_RESOURCE:
+ case BLK_STS_DEV_RESOURCE:
++ /*
++ * If direct dispatch fails, we cannot allow any merging on
++ * this IO. Drivers (like SCSI) may have set up permanent state
++ * for this request, like SG tables and mappings, and if we
++ * merge to it later on then we'll still only do IO to the
++ * original part.
++ */
++ rq->cmd_flags |= REQ_NOMERGE;
++
+ blk_mq_update_dispatch_busy(hctx, true);
+ __blk_mq_requeue_request(rq);
+ break;