diff options
author | Kyle De'Vir | 2018-12-06 15:35:28 +1000 |
---|---|---|
committer | Kyle De'Vir | 2018-12-06 15:35:28 +1000 |
commit | a4cc6805c8b2328fa41c2fa6941462f6b4a40e40 (patch) | |
tree | 46dcdba2032173ae1b5f32706a55b3added05905 | |
parent | d241dbf69f00fe664dd424e43a9d3d582fff20f4 (diff) | |
download | aur-a4cc6805c8b2328fa41c2fa6941462f6b4a40e40.tar.gz |
patch modification
-rwxr-xr-x | .SRCINFO | 2 | ||||
-rwxr-xr-x | PKGBUILD | 2 | ||||
-rw-r--r-- | ext4-corruption-patch.patch | 39 |
3 files changed, 37 insertions, 6 deletions
@@ -28,7 +28,7 @@ pkgbase = linux-bcachefs-git sha256sums = ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21 sha256sums = c043f3033bb781e2688794a59f6d1f7ed49ef9b13eb77ff9a425df33a244a636 sha256sums = ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65 - sha256sums = e0048bd7c614b3f31adba295b67263df0e7859a1587fac614df266a204b154f9 + sha256sums = c8b380f0237ba848615ca85964b8dd33366b234242a33d361f297e9347f1c0f4 pkgname = linux-bcachefs-git pkgdesc = The Linux-bcachefs-git kernel and modules @@ -53,7 +53,7 @@ sha256sums=('SKIP' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' 'c043f3033bb781e2688794a59f6d1f7ed49ef9b13eb77ff9a425df33a244a636' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65' - 'e0048bd7c614b3f31adba295b67263df0e7859a1587fac614df266a204b154f9') + 'c8b380f0237ba848615ca85964b8dd33366b234242a33d361f297e9347f1c0f4') _kernelname=${pkgbase#linux} : ${_kernelname:=-ARCH} diff --git a/ext4-corruption-patch.patch b/ext4-corruption-patch.patch index aa7f72653a7b..b058e39909ef 100644 --- a/ext4-corruption-patch.patch +++ b/ext4-corruption-patch.patch @@ -1,8 +1,39 @@ -@@ -, +, @@ +From: Jens Axboe <axboe@kernel.dk> +Subject: [PATCH] blk-mq: fix corruption with direct issue + +If we attempt a direct issue to a SCSI device, and it returns BUSY, then +we queue the request up normally. However, the SCSI layer may have +already setup SG tables etc for this particular command. If we later +merge with this request, then the old tables are no longer valid. Once +we issue the IO, we only read/write the original part of the request, +not the new state of it. + +This causes data corruption, and is most often noticed with the file +system complaining about the just read data being invalid: + +[ 235.934465] EXT4-fs error (device sda1): ext4_iget:4831: inode #7142: comm dpkg-query: bad extra_isize 24937 (inode size 256) + +because most of it is garbage... + +This doesn't happen from the normal issue path, as we will simply defer +the request to the hardware queue dispatch list if we fail. Once it's on +the dispatch list, we never merge with it. + +Fix this from the direct issue path by flagging the request as +REQ_NOMERGE so we don't change the size of it before issue. + +See also: https://bugzilla.kernel.org/show_bug.cgi?id=201685 + +Fixes: 6ce3dd6eec1 ("blk-mq: issue directly if hw queue isn't busy in case of 'none'") +Signed-off-by: Jens Axboe <axboe@kernel.dk> + --- ---- a/block/blk-mq.c -+++ a/block/blk-mq.c + +diff --git a/block/blk-mq.c b/block/blk-mq.c +index 3f91c6e5b17a..d8f518c6ea38 100644 +--- a/block/blk-mq.c ++++ b/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: @@ -18,4 +49,4 @@ + blk_mq_update_dispatch_busy(hctx, true); __blk_mq_requeue_request(rq); - break; + break; |