diff options
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch | 8 | ||||
-rw-r--r-- | 0002-blk-mq-fix-corruption-with-direct-issue.patch | 60 | ||||
-rw-r--r-- | PKGBUILD | 8 |
4 files changed, 73 insertions, 9 deletions
@@ -1,6 +1,6 @@ pkgbase = linux-rt-bfq pkgver = 4.19.5.4 - pkgrel = 5 + pkgrel = 6 url = https://github.com/Algodev-github/bfq-mq/ arch = x86_64 license = GPL2 @@ -26,6 +26,7 @@ pkgbase = linux-rt-bfq source = 99-linux.hook source = linux.preset source = 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch + source = 0002-blk-mq-fix-corruption-with-direct-issue.patch validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886 validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E validpgpkeys = 64254695FFF0AA4466CC19E67B96E8162A8CF5D1 @@ -45,7 +46,8 @@ pkgbase = linux-rt-bfq sha512sums = 2718b58dbbb15063bacb2bde6489e5b3c59afac4c0e0435b97fe720d42c711b6bcba926f67a8687878bd51373c9cf3adb1915a11666d79ccb220bf36e0788ab7 sha512sums = 8742e2eed421e2f29850e18616f435536c12036ff793f5682a3a8c980cf5dbfc88d17fd9539c87de15d9e4663dc3190f964f18a4722940465437927b6052abbf sha512sums = 2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf - sha512sums = 39c50e70d28ddaa2cca030f1050c3ead72d44d957a533d0d09a5a8b92d3743c5712fef1a60aacfcac8319346dd407247667e1c25a96cd2585e9d9b017ccd707c + sha512sums = 560920b4ebf8d7b753f058a41da62d20fde1e4b42a42e73be11461d3fe25b59bc36250a66d9c1c6e3c499426b237427af5ba7586daa7c549d2cf7bb7087932a1 + sha512sums = aef8da49ccc4639f43c2a16d67c207417e26a1ee40d7a98aaa397038ef4a288b2361b951dcb2e1813df287041c482ab0e497fa161edafdc46446ab45311104dc pkgname = linux-rt-bfq pkgdesc = The Linux-rt-bfq kernel and modules with the RT patch and the BFQ-MQ scheduler. diff --git a/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch b/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch index 109640b12f2f..2c9dba3c59a4 100644 --- a/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch +++ b/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch @@ -1,7 +1,7 @@ -From 4b38af06b758979fd674096c0a64f7af49ce3022 Mon Sep 17 00:00:00 2001 +From a1535c25955d82556da3bf06db7735b4267369e8 Mon Sep 17 00:00:00 2001 From: Serge Hallyn <serge.hallyn@canonical.com> Date: Fri, 31 May 2013 19:12:12 +0100 -Subject: [PATCH] add sysctl to disallow unprivileged CLONE_NEWUSER by +Subject: [PATCH 1/2] add sysctl to disallow unprivileged CLONE_NEWUSER by default Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> @@ -84,7 +84,7 @@ index cc02050fd0c4..ce2ad2b92897 100644 { .procname = "tainted", diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c -index e5222b5fb4fe..c941a66e51d1 100644 +index 923414a246e9..6b9dbc257e34 100644 --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c @@ -26,6 +26,9 @@ @@ -98,5 +98,5 @@ index e5222b5fb4fe..c941a66e51d1 100644 static DEFINE_MUTEX(userns_state_mutex); -- -2.19.1.542.gc4df23f792 +2.20.0.rc2.7.g965798d1f2 diff --git a/0002-blk-mq-fix-corruption-with-direct-issue.patch b/0002-blk-mq-fix-corruption-with-direct-issue.patch new file mode 100644 index 000000000000..5ca4828bc1f9 --- /dev/null +++ b/0002-blk-mq-fix-corruption-with-direct-issue.patch @@ -0,0 +1,60 @@ +From 144c54b5c08cc1afc060281a79a9892e898337c6 Mon Sep 17 00:00:00 2001 +From: Jens Axboe <axboe@kernel.dk> +Date: Tue, 4 Dec 2018 15:47:46 -0700 +Subject: [PATCH 2/2] 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> +Tested-by: Guenter Roeck <linux@roeck-us.net> +Reviewed-by: Christoph Hellwig <hch@lst.de> +--- + block/blk-mq.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/block/blk-mq.c b/block/blk-mq.c +index e3c39ea8e17b..66d64a13c50a 100644 +--- a/block/blk-mq.c ++++ b/block/blk-mq.c +@@ -1698,6 +1698,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; +-- +2.20.0.rc2.7.g965798d1f2 + @@ -58,7 +58,7 @@ pkgver=${_major}.${_minor}.${_rtver} _pkgver=${_major}.${_minor} _srcname=linux-${_pkgver} _rtpatchver=rt${_rtver} -pkgrel=5 +pkgrel=6 arch=('x86_64') url="https://github.com/Algodev-github/bfq-mq/" license=('GPL2') @@ -92,7 +92,8 @@ source=("https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz" '99-linux.hook' # standard config files for mkinitcpio ramdisk 'linux.preset' - '0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch') + '0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch' + '0002-blk-mq-fix-corruption-with-direct-issue.patch') _kernelname=${pkgbase#linux} : ${_kernelname:=-rt-bfq} @@ -402,7 +403,8 @@ sha512sums=('ee460800a071aeae966078d3e7dc525e1e8e9cbb406fe878438c55da4ea42d10f50 '2718b58dbbb15063bacb2bde6489e5b3c59afac4c0e0435b97fe720d42c711b6bcba926f67a8687878bd51373c9cf3adb1915a11666d79ccb220bf36e0788ab7' '8742e2eed421e2f29850e18616f435536c12036ff793f5682a3a8c980cf5dbfc88d17fd9539c87de15d9e4663dc3190f964f18a4722940465437927b6052abbf' '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf' - '39c50e70d28ddaa2cca030f1050c3ead72d44d957a533d0d09a5a8b92d3743c5712fef1a60aacfcac8319346dd407247667e1c25a96cd2585e9d9b017ccd707c') + '560920b4ebf8d7b753f058a41da62d20fde1e4b42a42e73be11461d3fe25b59bc36250a66d9c1c6e3c499426b237427af5ba7586daa7c549d2cf7bb7087932a1' + 'aef8da49ccc4639f43c2a16d67c207417e26a1ee40d7a98aaa397038ef4a288b2361b951dcb2e1813df287041c482ab0e497fa161edafdc46446ab45311104dc') validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds |