From: Greg Kroah-Hartman Date: Mon, 30 Jul 2018 08:23:07 +0000 (+0200) Subject: drop some 4.14 and 4.17 patches X-Git-Tag: v4.17.12~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08d3321a74751b14218d75ee812e56057264e6fc;p=thirdparty%2Fkernel%2Fstable-queue.git drop some 4.14 and 4.17 patches --- diff --git a/queue-4.14/block-bio_iov_iter_get_pages-pin-more-pages-for-multi-segment-ios.patch b/queue-4.14/block-bio_iov_iter_get_pages-pin-more-pages-for-multi-segment-ios.patch deleted file mode 100644 index 5273a1b1a45..00000000000 --- a/queue-4.14/block-bio_iov_iter_get_pages-pin-more-pages-for-multi-segment-ios.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 17d51b10d7773e4618bcac64648f30f12d4078fb Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 25 Jul 2018 23:15:09 +0200 -Subject: block: bio_iov_iter_get_pages: pin more pages for multi-segment IOs - -From: Martin Wilck - -commit 17d51b10d7773e4618bcac64648f30f12d4078fb upstream. - -bio_iov_iter_get_pages() currently only adds pages for the next non-zero -segment from the iov_iter to the bio. That's suboptimal for callers, -which typically try to pin as many pages as fit into the bio. This patch -converts the current bio_iov_iter_get_pages() into a static helper, and -introduces a new helper that allocates as many pages as - - 1) fit into the bio, - 2) are present in the iov_iter, - 3) and can be pinned by MM. - -Error is returned only if zero pages could be pinned. Because of 3), a -zero return value doesn't necessarily mean all pages have been pinned. -Callers that have to pin every page in the iov_iter must still call this -function in a loop (this is currently the case). - -This change matters most for __blkdev_direct_IO_simple(), which calls -bio_iov_iter_get_pages() only once. If it obtains less pages than -requested, it returns a "short write" or "short read", and -__generic_file_write_iter() falls back to buffered writes, which may -lead to data corruption. - -Fixes: 72ecad22d9f1 ("block: support a full bio worth of IO for simplified bdev direct-io") -Reviewed-by: Christoph Hellwig -Signed-off-by: Martin Wilck -Signed-off-by: Jens Axboe -Signed-off-by: Greg Kroah-Hartman - ---- - block/bio.c | 35 ++++++++++++++++++++++++++++++++--- - 1 file changed, 32 insertions(+), 3 deletions(-) - ---- a/block/bio.c -+++ b/block/bio.c -@@ -872,14 +872,16 @@ done: - EXPORT_SYMBOL(bio_add_page); - - /** -- * bio_iov_iter_get_pages - pin user or kernel pages and add them to a bio -+ * __bio_iov_iter_get_pages - pin user or kernel pages and add them to a bio - * @bio: bio to add pages to - * @iter: iov iterator describing the region to be mapped - * -- * Pins as many pages from *iter and appends them to @bio's bvec array. The -+ * Pins pages from *iter and appends them to @bio's bvec array. The - * pages will have to be released using put_page() when done. -+ * For multi-segment *iter, this function only adds pages from the -+ * the next non-empty segment of the iov iterator. - */ --int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) -+static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) - { - unsigned short nr_pages = bio->bi_max_vecs - bio->bi_vcnt, idx; - struct bio_vec *bv = bio->bi_io_vec + bio->bi_vcnt; -@@ -916,6 +918,33 @@ int bio_iov_iter_get_pages(struct bio *b - iov_iter_advance(iter, size); - return 0; - } -+ -+/** -+ * bio_iov_iter_get_pages - pin user or kernel pages and add them to a bio -+ * @bio: bio to add pages to -+ * @iter: iov iterator describing the region to be mapped -+ * -+ * Pins pages from *iter and appends them to @bio's bvec array. The -+ * pages will have to be released using put_page() when done. -+ * The function tries, but does not guarantee, to pin as many pages as -+ * fit into the bio, or are requested in *iter, whatever is smaller. -+ * If MM encounters an error pinning the requested pages, it stops. -+ * Error is returned only if 0 pages could be pinned. -+ */ -+int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) -+{ -+ unsigned short orig_vcnt = bio->bi_vcnt; -+ -+ do { -+ int ret = __bio_iov_iter_get_pages(bio, iter); -+ -+ if (unlikely(ret)) -+ return bio->bi_vcnt > orig_vcnt ? 0 : ret; -+ -+ } while (iov_iter_count(iter) && !bio_full(bio)); -+ -+ return 0; -+} - EXPORT_SYMBOL_GPL(bio_iov_iter_get_pages); - - struct submit_bio_ret { diff --git a/queue-4.14/nvmet-fixup-crash-on-null-device-path.patch b/queue-4.14/nvmet-fixup-crash-on-null-device-path.patch deleted file mode 100644 index d1f32c3b302..00000000000 --- a/queue-4.14/nvmet-fixup-crash-on-null-device-path.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 5613d31214eb4c5c04cdfce4966bb661c8b43191 Mon Sep 17 00:00:00 2001 -From: Hannes Reinecke -Date: Wed, 25 Jul 2018 08:35:17 +0200 -Subject: nvmet: fixup crash on NULL device path - -From: Hannes Reinecke - -commit 5613d31214eb4c5c04cdfce4966bb661c8b43191 upstream. - -When writing an empty string into the device_path attribute the kernel -will crash with - -nvmet: failed to open block device (null): (-22) -BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 - -This patch sanitizes the error handling for invalid device path settings. - -Fixes: a07b4970 ("nvmet: add a generic NVMe target") -Signed-off-by: Hannes Reinecke -Reviewed-by: Chaitanya Kulkarni -Signed-off-by: Christoph Hellwig -Signed-off-by: Greg Kroah-Hartman - -diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c -index d3f3b3ec4d1a..ebea1373d1b7 100644 ---- a/drivers/nvme/target/configfs.c -+++ b/drivers/nvme/target/configfs.c -@@ -282,6 +282,7 @@ static ssize_t nvmet_ns_device_path_store(struct config_item *item, - { - struct nvmet_ns *ns = to_nvmet_ns(item); - struct nvmet_subsys *subsys = ns->subsys; -+ size_t len; - int ret; - - mutex_lock(&subsys->lock); -@@ -289,10 +290,14 @@ static ssize_t nvmet_ns_device_path_store(struct config_item *item, - if (ns->enabled) - goto out_unlock; - -- kfree(ns->device_path); -+ ret = -EINVAL; -+ len = strcspn(page, "\n"); -+ if (!len) -+ goto out_unlock; - -+ kfree(ns->device_path); - ret = -ENOMEM; -- ns->device_path = kstrndup(page, strcspn(page, "\n"), GFP_KERNEL); -+ ns->device_path = kstrndup(page, len, GFP_KERNEL); - if (!ns->device_path) - goto out_unlock; - diff --git a/queue-4.14/series b/queue-4.14/series index 0f2b9cdaed3..9e30f7a83e8 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -217,10 +217,8 @@ drm-dp-mst-fix-off-by-one-typo-when-dump-payload-table.patch block-bio_iov_iter_get_pages-fix-size-of-last-iovec.patch blkdev-__blkdev_direct_io_simple-fix-leak-in-error-case.patch block-reset-bi_iter.bi_done-after-splitting-bio.patch -block-bio_iov_iter_get_pages-pin-more-pages-for-multi-segment-ios.patch random-mix-rdrand-with-entropy-sent-in-from-userspace.patch squashfs-be-more-careful-about-metadata-corruption.patch ext4-fix-inline-data-updates-with-checksums-enabled.patch ext4-check-for-allocation-block-validity-with-block-group-locked.patch ext4-fix-check-to-prevent-initializing-reserved-inodes.patch -nvmet-fixup-crash-on-null-device-path.patch diff --git a/queue-4.17/block-bio_iov_iter_get_pages-pin-more-pages-for-multi-segment-ios.patch b/queue-4.17/block-bio_iov_iter_get_pages-pin-more-pages-for-multi-segment-ios.patch deleted file mode 100644 index c5de12d0711..00000000000 --- a/queue-4.17/block-bio_iov_iter_get_pages-pin-more-pages-for-multi-segment-ios.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 17d51b10d7773e4618bcac64648f30f12d4078fb Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 25 Jul 2018 23:15:09 +0200 -Subject: block: bio_iov_iter_get_pages: pin more pages for multi-segment IOs - -From: Martin Wilck - -commit 17d51b10d7773e4618bcac64648f30f12d4078fb upstream. - -bio_iov_iter_get_pages() currently only adds pages for the next non-zero -segment from the iov_iter to the bio. That's suboptimal for callers, -which typically try to pin as many pages as fit into the bio. This patch -converts the current bio_iov_iter_get_pages() into a static helper, and -introduces a new helper that allocates as many pages as - - 1) fit into the bio, - 2) are present in the iov_iter, - 3) and can be pinned by MM. - -Error is returned only if zero pages could be pinned. Because of 3), a -zero return value doesn't necessarily mean all pages have been pinned. -Callers that have to pin every page in the iov_iter must still call this -function in a loop (this is currently the case). - -This change matters most for __blkdev_direct_IO_simple(), which calls -bio_iov_iter_get_pages() only once. If it obtains less pages than -requested, it returns a "short write" or "short read", and -__generic_file_write_iter() falls back to buffered writes, which may -lead to data corruption. - -Fixes: 72ecad22d9f1 ("block: support a full bio worth of IO for simplified bdev direct-io") -Reviewed-by: Christoph Hellwig -Signed-off-by: Martin Wilck -Signed-off-by: Jens Axboe -Signed-off-by: Greg Kroah-Hartman - ---- - block/bio.c | 35 ++++++++++++++++++++++++++++++++--- - 1 file changed, 32 insertions(+), 3 deletions(-) - ---- a/block/bio.c -+++ b/block/bio.c -@@ -872,14 +872,16 @@ done: - EXPORT_SYMBOL(bio_add_page); - - /** -- * bio_iov_iter_get_pages - pin user or kernel pages and add them to a bio -+ * __bio_iov_iter_get_pages - pin user or kernel pages and add them to a bio - * @bio: bio to add pages to - * @iter: iov iterator describing the region to be mapped - * -- * Pins as many pages from *iter and appends them to @bio's bvec array. The -+ * Pins pages from *iter and appends them to @bio's bvec array. The - * pages will have to be released using put_page() when done. -+ * For multi-segment *iter, this function only adds pages from the -+ * the next non-empty segment of the iov iterator. - */ --int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) -+static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) - { - unsigned short nr_pages = bio->bi_max_vecs - bio->bi_vcnt, idx; - struct bio_vec *bv = bio->bi_io_vec + bio->bi_vcnt; -@@ -916,6 +918,33 @@ int bio_iov_iter_get_pages(struct bio *b - iov_iter_advance(iter, size); - return 0; - } -+ -+/** -+ * bio_iov_iter_get_pages - pin user or kernel pages and add them to a bio -+ * @bio: bio to add pages to -+ * @iter: iov iterator describing the region to be mapped -+ * -+ * Pins pages from *iter and appends them to @bio's bvec array. The -+ * pages will have to be released using put_page() when done. -+ * The function tries, but does not guarantee, to pin as many pages as -+ * fit into the bio, or are requested in *iter, whatever is smaller. -+ * If MM encounters an error pinning the requested pages, it stops. -+ * Error is returned only if 0 pages could be pinned. -+ */ -+int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) -+{ -+ unsigned short orig_vcnt = bio->bi_vcnt; -+ -+ do { -+ int ret = __bio_iov_iter_get_pages(bio, iter); -+ -+ if (unlikely(ret)) -+ return bio->bi_vcnt > orig_vcnt ? 0 : ret; -+ -+ } while (iov_iter_count(iter) && !bio_full(bio)); -+ -+ return 0; -+} - EXPORT_SYMBOL_GPL(bio_iov_iter_get_pages); - - static void submit_bio_wait_endio(struct bio *bio) diff --git a/queue-4.17/series b/queue-4.17/series index af753c20073..573e625eb3a 100644 --- a/queue-4.17/series +++ b/queue-4.17/series @@ -299,7 +299,6 @@ drm-amdgpu-avoid-reclaim-while-holding-locks-taken-in-mmu-notifier.patch block-bio_iov_iter_get_pages-fix-size-of-last-iovec.patch blkdev-__blkdev_direct_io_simple-fix-leak-in-error-case.patch block-reset-bi_iter.bi_done-after-splitting-bio.patch -block-bio_iov_iter_get_pages-pin-more-pages-for-multi-segment-ios.patch nvmet-fc-fix-target-sgl-list-on-large-transfers.patch i2c-rcar-handle-rxdma-hw-behaviour-on-gen3.patch random-mix-rdrand-with-entropy-sent-in-from-userspace.patch