From: Sasha Levin Date: Fri, 23 Nov 2018 20:02:11 +0000 (-0500) Subject: patches for 3.18 X-Git-Tag: v3.18.127~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13c0e91b0131ac0e8543757780f06aa05e431d52;p=thirdparty%2Fkernel%2Fstable-queue.git patches for 3.18 Signed-off-by: Sasha Levin --- diff --git a/queue-3.18/revert-revert-drm-i915-fix-mutex-owner-inspection-ra.patch b/queue-3.18/revert-revert-drm-i915-fix-mutex-owner-inspection-ra.patch new file mode 100644 index 00000000000..41a244361e1 --- /dev/null +++ b/queue-3.18/revert-revert-drm-i915-fix-mutex-owner-inspection-ra.patch @@ -0,0 +1,34 @@ +From 8d6229454b42d4e1aa55ef8dbcb22d472d88c414 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 23 Nov 2018 14:05:17 -0500 +Subject: Revert "Revert "drm/i915: Fix mutex->owner inspection race under + DEBUG_MUTEXES"" + +This reverts commit bc07ee33284ac6e6872d5efad1b321ec0b7b46a4. Which is +upstream commit a50940510e94f5fb65ffd79877a60592d85598a9. + +This revert relies on upstream commit a63b03e2d24 ("mutex: Always clear +owner field upon mutex_unlock()") being in the tree, but that commit +should not be backported. + +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/i915/i915_gem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c +index d0f0a7943d88..d88dbedeaa77 100644 +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -5144,7 +5144,7 @@ static bool mutex_is_locked_by(struct mutex *mutex, struct task_struct *task) + if (!mutex_is_locked(mutex)) + return false; + +-#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_MUTEXES) ++#if defined(CONFIG_SMP) && !defined(CONFIG_DEBUG_MUTEXES) + return mutex->owner == task; + #else + /* Since UP may be pre-empted, we cannot assume that we own the lock */ +-- +2.17.1 + diff --git a/queue-3.18/series b/queue-3.18/series index f979cc013f2..a3e47fcd681 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -8,3 +8,6 @@ clk-samsung-exynos5420-enable-peris-clocks-for-suspe.patch s390-vdso-add-missing-force-to-build-targets.patch lib-raid6-fix-arm64-test-build.patch i2c-omap-enable-for-arch_k3.patch +zram-close-udev-startup-race-condition-as-default-gr.patch +revert-revert-drm-i915-fix-mutex-owner-inspection-ra.patch +sunrpc-drop-pointless-static-qualifier-in-xdr_get_ne.patch diff --git a/queue-3.18/sunrpc-drop-pointless-static-qualifier-in-xdr_get_ne.patch b/queue-3.18/sunrpc-drop-pointless-static-qualifier-in-xdr_get_ne.patch new file mode 100644 index 00000000000..57b6d12cdd6 --- /dev/null +++ b/queue-3.18/sunrpc-drop-pointless-static-qualifier-in-xdr_get_ne.patch @@ -0,0 +1,35 @@ +From d94a907d76d529f82da11b68d79861bc866970f0 Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Thu, 8 Nov 2018 02:04:57 +0000 +Subject: SUNRPC: drop pointless static qualifier in + xdr_get_next_encode_buffer() + +[ Upstream commit 025911a5f4e36955498ed50806ad1b02f0f76288 ] + +There is no need to have the '__be32 *p' variable static since new value +always be assigned before use it. + +Signed-off-by: YueHaibing +Cc: stable@vger.kernel.org +Signed-off-by: J. Bruce Fields +Signed-off-by: Sasha Levin +--- + net/sunrpc/xdr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c +index 6de975ae7f5b..3cdd34d2a9fc 100644 +--- a/net/sunrpc/xdr.c ++++ b/net/sunrpc/xdr.c +@@ -512,7 +512,7 @@ EXPORT_SYMBOL_GPL(xdr_commit_encode); + static __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr, + size_t nbytes) + { +- static __be32 *p; ++ __be32 *p; + int space_left; + int frag1bytes, frag2bytes; + +-- +2.17.1 + diff --git a/queue-3.18/zram-close-udev-startup-race-condition-as-default-gr.patch b/queue-3.18/zram-close-udev-startup-race-condition-as-default-gr.patch new file mode 100644 index 00000000000..ba24a7e6e3d --- /dev/null +++ b/queue-3.18/zram-close-udev-startup-race-condition-as-default-gr.patch @@ -0,0 +1,87 @@ +From 07080c06d3449f1abf9b238f063ae78855e93b16 Mon Sep 17 00:00:00 2001 +From: Minchan Kim +Date: Fri, 23 Nov 2018 15:30:22 +0900 +Subject: zram: close udev startup race condition as default groups + +commit fef912bf860e upstream. +commit 98af4d4df889 upstream. + +I got a report from Howard Chen that he saw zram and sysfs race(ie, +zram block device file is created but sysfs for it isn't yet) +when he tried to create new zram devices via hotadd knob. + +v4.20 kernel fixes it by [1, 2] but it's too large size to merge +into -stable so this patch fixes the problem by registering defualt +group by Greg KH's approach[3]. + +This patch should be applied to every stable tree [3.16+] currently +existing from kernel.org because the problem was introduced at 2.6.37 +by [4]. + +[1] fef912bf860e, block: genhd: add 'groups' argument to device_add_disk +[2] 98af4d4df889, zram: register default groups with device_add_disk() +[3] http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/ +[4] 33863c21e69e9, Staging: zram: Replace ioctls with sysfs interface + +Cc: Sergey Senozhatsky +Cc: Hannes Reinecke +Tested-by: Howard Chen +Signed-off-by: Minchan Kim +Signed-off-by: Sasha Levin +--- + drivers/block/zram/zram_drv.c | 18 ++++++------------ + 1 file changed, 6 insertions(+), 12 deletions(-) + +diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c +index 7e94459a489a..5f4e6a3c2dde 100644 +--- a/drivers/block/zram/zram_drv.c ++++ b/drivers/block/zram/zram_drv.c +@@ -999,6 +999,11 @@ static struct attribute_group zram_disk_attr_group = { + .attrs = zram_disk_attrs, + }; + ++static const struct attribute_group *zram_disk_attr_groups[] = { ++ &zram_disk_attr_group, ++ NULL, ++}; ++ + static int create_device(struct zram *zram, int device_id) + { + int ret = -ENOMEM; +@@ -1060,22 +1065,14 @@ static int create_device(struct zram *zram, int device_id) + zram->disk->queue->limits.discard_zeroes_data = 0; + queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, zram->disk->queue); + ++ disk_to_dev(zram->disk)->groups = zram_disk_attr_groups; + add_disk(zram->disk); + +- ret = sysfs_create_group(&disk_to_dev(zram->disk)->kobj, +- &zram_disk_attr_group); +- if (ret < 0) { +- pr_warn("Error creating sysfs group"); +- goto out_free_disk; +- } + strlcpy(zram->compressor, default_compressor, sizeof(zram->compressor)); + zram->meta = NULL; + zram->max_comp_streams = 1; + return 0; + +-out_free_disk: +- del_gendisk(zram->disk); +- put_disk(zram->disk); + out_free_queue: + blk_cleanup_queue(zram->queue); + out: +@@ -1084,9 +1081,6 @@ out: + + static void destroy_device(struct zram *zram) + { +- sysfs_remove_group(&disk_to_dev(zram->disk)->kobj, +- &zram_disk_attr_group); +- + del_gendisk(zram->disk); + put_disk(zram->disk); + +-- +2.17.1 +