Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2019-01-22 07:04:38 +0100
committerKernel Build Daemon <kbuild@suse.de>2019-01-22 07:04:38 +0100
commit804b9c2eed35938d37fb07d208f550b5c0d260c2 (patch)
tree334ef05b4750df61f0ac8777712951ece02222e2
parentc2ad524ffa46615f7db332d612cded6fb2960f5b (diff)
parentca68b03780fd48708e440269f871ce05e188d0f2 (diff)
Merge branch 'SLE15' into SLE15-AZURE
-rw-r--r--patches.drm/0001-drm-fb-helper-Partially-bring-back-workaround-for-bu.patch221
-rw-r--r--patches.drm/0001-drm-i915-gvt-Fix-mmap-range-check.patch61
-rw-r--r--patches.drm/0002-omap2fb-Fix-stack-memory-disclosure.patch44
-rw-r--r--patches.fixes/acpi-nfit-fix-race-accessing-memdev-in-nfit_get_smbios_id.patch49
-rw-r--r--patches.fixes/blkdev-avoid-migration-stalls-for-blkdev-pages.patch46
-rw-r--r--patches.fixes/mm-migrate-Make-buffer_migrate_page_norefs-actually-.patch62
-rw-r--r--patches.fixes/mm-migrate-lock-buffers-before-migrate_page_move_map.patch79
-rw-r--r--patches.fixes/mm-migrate-provide-buffer_migrate_page_norefs.patch125
-rw-r--r--patches.fixes/mm-migration-factor-out-code-to-compute-expected-num.patch92
-rw-r--r--patches.suse/drm-i915-CFL-NVMe-breakage-workaround.patch37
-rw-r--r--scripts/git_sort/quilt-mode.sh4
-rwxr-xr-xscripts/git_sort/series_sort.py29
-rwxr-xr-xscripts/python/tests/test_header.py308
-rwxr-xr-xscripts/tar-up.sh3
-rw-r--r--series.conf11
15 files changed, 958 insertions, 213 deletions
diff --git a/patches.drm/0001-drm-fb-helper-Partially-bring-back-workaround-for-bu.patch b/patches.drm/0001-drm-fb-helper-Partially-bring-back-workaround-for-bu.patch
new file mode 100644
index 0000000000..369950a40a
--- /dev/null
+++ b/patches.drm/0001-drm-fb-helper-Partially-bring-back-workaround-for-bu.patch
@@ -0,0 +1,221 @@
+From 62d85b3bf9d978ed4b6b2aeef5cf0ccf1423906e Mon Sep 17 00:00:00 2001
+From: Ivan Mironov <mironov.ivan@gmail.com>
+Date: Tue, 8 Jan 2019 12:23:52 +0500
+Subject: drm/fb-helper: Partially bring back workaround for bugs of SDL 1.2
+Git-commit: 62d85b3bf9d978ed4b6b2aeef5cf0ccf1423906e
+Patch-mainline: v5.0-rc2
+References: bsc#1113722
+
+SDL 1.2 sets all fields related to the pixel format to zero in some
+cases[1]. Prior to commit db05c48197759 ("drm: fb-helper: Reject all
+pixel format changing requests"), there was an unintentional workaround
+for this that existed for more than a decade. First in device-specific DRM
+drivers, then here in drm_fb_helper.c.
+
+Previous code containing this workaround just ignores pixel format fields
+from userspace code. Not a good thing either, as this way, driver may
+silently use pixel format different from what client actually requested,
+and this in turn will lead to displaying garbage on the screen. I think
+that returning EINVAL to userspace in this particular case is the right
+option, so I decided to left code from problematic commit untouched
+instead of just reverting it entirely.
+
+Here is the steps required to reproduce this problem exactly:
+ 1) Compile fceux[2] with SDL 1.2.15 and without GTK or OpenGL
+ support. SDL should be compiled with fbdev support (which is
+ on by default).
+ 2) Create /etc/fb.modes with following contents (values seems
+ not used, and just required to trigger problematic code in
+ SDL):
+
+ mode "test"
+ geometry 1 1 1 1 1
+ timings 1 1 1 1 1 1 1
+ endmode
+
+ 3) Create ~/.fceux/fceux.cfg with following contents:
+
+ SDL.Hotkeys.Quit = 27
+ SDL.DoubleBuffering = 1
+
+ 4) Ensure that screen resolution is at least 1280x960 (e.g.
+ append "video=Virtual-1:1280x960-32" to the kernel cmdline
+ for qemu/QXL).
+
+ 5) Try to run fceux on VT with some ROM file[3]:
+
+ # ./fceux color_test.nes
+
+[1] SDL 1.2.15 source code, src/video/fbcon/SDL_fbvideo.c,
+ FB_SetVideoMode()
+[2] http://www.fceux.com
+[3] Example ROM: https://github.com/bokuweb/rustynes/blob/master/roms/color_test.nes
+
+Reported-by: saahriktu <mail@saahriktu.org>
+Suggested-by: saahriktu <mail@saahriktu.org>
+Cc: stable@vger.kernel.org
+Fixes: db05c48197759 ("drm: fb-helper: Reject all pixel format changing requests")
+Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
+[danvet: Delete misleading comment.]
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Link: https://patchwork.freedesktop.org/patch/msgid/20190108072353.28078-2-mironov.ivan@gmail.com
+Link: https://patchwork.freedesktop.org/patch/msgid/20190108072353.28078-2-mironov.ivan@gmail.com
+Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
+---
+ drivers/gpu/drm/drm_fb_helper.c | 126 ++++++++++++++++++--------------
+ 1 file changed, 73 insertions(+), 53 deletions(-)
+
+diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
+index d3af098b0922..2d7ce9d3143f 100644
+--- a/drivers/gpu/drm/drm_fb_helper.c
++++ b/drivers/gpu/drm/drm_fb_helper.c
+@@ -1621,6 +1621,64 @@ static bool drm_fb_pixel_format_equal(const struct fb_var_screeninfo *var_1,
+ var_1->transp.msb_right == var_2->transp.msb_right;
+ }
+
++static void drm_fb_helper_fill_pixel_fmt(struct fb_var_screeninfo *var,
++ u8 depth)
++{
++ switch (depth) {
++ case 8:
++ var->red.offset = 0;
++ var->green.offset = 0;
++ var->blue.offset = 0;
++ var->red.length = 8; /* 8bit DAC */
++ var->green.length = 8;
++ var->blue.length = 8;
++ var->transp.offset = 0;
++ var->transp.length = 0;
++ break;
++ case 15:
++ var->red.offset = 10;
++ var->green.offset = 5;
++ var->blue.offset = 0;
++ var->red.length = 5;
++ var->green.length = 5;
++ var->blue.length = 5;
++ var->transp.offset = 15;
++ var->transp.length = 1;
++ break;
++ case 16:
++ var->red.offset = 11;
++ var->green.offset = 5;
++ var->blue.offset = 0;
++ var->red.length = 5;
++ var->green.length = 6;
++ var->blue.length = 5;
++ var->transp.offset = 0;
++ break;
++ case 24:
++ var->red.offset = 16;
++ var->green.offset = 8;
++ var->blue.offset = 0;
++ var->red.length = 8;
++ var->green.length = 8;
++ var->blue.length = 8;
++ var->transp.offset = 0;
++ var->transp.length = 0;
++ break;
++ case 32:
++ var->red.offset = 16;
++ var->green.offset = 8;
++ var->blue.offset = 0;
++ var->red.length = 8;
++ var->green.length = 8;
++ var->blue.length = 8;
++ var->transp.offset = 24;
++ var->transp.length = 8;
++ break;
++ default:
++ break;
++ }
++}
++
+ /**
+ * drm_fb_helper_check_var - implementation for &fb_ops.fb_check_var
+ * @var: screeninfo to check
+@@ -1654,6 +1712,20 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
+ return -EINVAL;
+ }
+
++ /*
++ * Workaround for SDL 1.2, which is known to be setting all pixel format
++ * fields values to zero in some cases. We treat this situation as a
++ * kind of "use some reasonable autodetected values".
++ */
++ if (!var->red.offset && !var->green.offset &&
++ !var->blue.offset && !var->transp.offset &&
++ !var->red.length && !var->green.length &&
++ !var->blue.length && !var->transp.length &&
++ !var->red.msb_right && !var->green.msb_right &&
++ !var->blue.msb_right && !var->transp.msb_right) {
++ drm_fb_helper_fill_pixel_fmt(var, fb->format->depth);
++ }
++
+ /*
+ * drm fbdev emulation doesn't support changing the pixel format at all,
+ * so reject all pixel format changing requests.
+@@ -1967,59 +2039,7 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe
+ info->var.yoffset = 0;
+ info->var.activate = FB_ACTIVATE_NOW;
+
+- switch (fb->format->depth) {
+- case 8:
+- info->var.red.offset = 0;
+- info->var.green.offset = 0;
+- info->var.blue.offset = 0;
+- info->var.red.length = 8; /* 8bit DAC */
+- info->var.green.length = 8;
+- info->var.blue.length = 8;
+- info->var.transp.offset = 0;
+- info->var.transp.length = 0;
+- break;
+- case 15:
+- info->var.red.offset = 10;
+- info->var.green.offset = 5;
+- info->var.blue.offset = 0;
+- info->var.red.length = 5;
+- info->var.green.length = 5;
+- info->var.blue.length = 5;
+- info->var.transp.offset = 15;
+- info->var.transp.length = 1;
+- break;
+- case 16:
+- info->var.red.offset = 11;
+- info->var.green.offset = 5;
+- info->var.blue.offset = 0;
+- info->var.red.length = 5;
+- info->var.green.length = 6;
+- info->var.blue.length = 5;
+- info->var.transp.offset = 0;
+- break;
+- case 24:
+- info->var.red.offset = 16;
+- info->var.green.offset = 8;
+- info->var.blue.offset = 0;
+- info->var.red.length = 8;
+- info->var.green.length = 8;
+- info->var.blue.length = 8;
+- info->var.transp.offset = 0;
+- info->var.transp.length = 0;
+- break;
+- case 32:
+- info->var.red.offset = 16;
+- info->var.green.offset = 8;
+- info->var.blue.offset = 0;
+- info->var.red.length = 8;
+- info->var.green.length = 8;
+- info->var.blue.length = 8;
+- info->var.transp.offset = 24;
+- info->var.transp.length = 8;
+- break;
+- default:
+- break;
+- }
++ drm_fb_helper_fill_pixel_fmt(&info->var, fb->format->depth);
+
+ info->var.xres = fb_width;
+ info->var.yres = fb_height;
+--
+2.20.1
+
diff --git a/patches.drm/0001-drm-i915-gvt-Fix-mmap-range-check.patch b/patches.drm/0001-drm-i915-gvt-Fix-mmap-range-check.patch
new file mode 100644
index 0000000000..b92d55bb53
--- /dev/null
+++ b/patches.drm/0001-drm-i915-gvt-Fix-mmap-range-check.patch
@@ -0,0 +1,61 @@
+From 51b00d8509dc69c98740da2ad07308b630d3eb7d Mon Sep 17 00:00:00 2001
+From: Zhenyu Wang <zhenyuw@linux.intel.com>
+Date: Fri, 11 Jan 2019 13:58:53 +0800
+Subject: drm/i915/gvt: Fix mmap range check
+Git-commit: 51b00d8509dc69c98740da2ad07308b630d3eb7d
+Patch-mainline: v5.0-rc3
+References: bsc#1120902
+
+This is to fix missed mmap range check on vGPU bar2 region
+and only allow to map vGPU allocated GMADDR range, which means
+user space should support sparse mmap to get proper offset for
+mmap vGPU aperture. And this takes care of actual pgoff in mmap
+request as original code always does from beginning of vGPU
+aperture.
+
+Fixes: 659643f7d814 ("drm/i915/gvt/kvmgt: add vfio/mdev support to KVMGT")
+Cc: "Monroy, Rodrigo Axel" <rodrigo.axel.monroy@intel.com>
+Cc: "Orrala Contreras, Alfredo" <alfredo.orrala.contreras@intel.com>
+Cc: stable@vger.kernel.org # v4.10+
+Reviewed-by: Hang Yuan <hang.yuan@intel.com>
+Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
+Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
+---
+ drivers/gpu/drm/i915/gvt/kvmgt.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
+index a3ee6b7c3cfc..dd3dfd00f4e6 100644
+--- a/drivers/gpu/drm/i915/gvt/kvmgt.c
++++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
+@@ -996,7 +996,7 @@ static int intel_vgpu_mmap(struct mdev_device *mdev, struct vm_area_struct *vma)
+ {
+ unsigned int index;
+ u64 virtaddr;
+- unsigned long req_size, pgoff = 0;
++ unsigned long req_size, pgoff, req_start;
+ pgprot_t pg_prot;
+ struct intel_vgpu *vgpu = mdev_get_drvdata(mdev);
+
+@@ -1014,7 +1014,17 @@ static int intel_vgpu_mmap(struct mdev_device *mdev, struct vm_area_struct *vma)
+ pg_prot = vma->vm_page_prot;
+ virtaddr = vma->vm_start;
+ req_size = vma->vm_end - vma->vm_start;
+- pgoff = vgpu_aperture_pa_base(vgpu) >> PAGE_SHIFT;
++ pgoff = vma->vm_pgoff &
++ ((1U << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1);
++ req_start = pgoff << PAGE_SHIFT;
++
++ if (!intel_vgpu_in_aperture(vgpu, req_start))
++ return -EINVAL;
++ if (req_start + req_size >
++ vgpu_aperture_offset(vgpu) + vgpu_aperture_sz(vgpu))
++ return -EINVAL;
++
++ pgoff = (gvt_aperture_pa_base(vgpu->gvt) >> PAGE_SHIFT) + pgoff;
+
+ return remap_pfn_range(vma, virtaddr, pgoff, req_size, pg_prot);
+ }
+--
+2.20.1
+
diff --git a/patches.drm/0002-omap2fb-Fix-stack-memory-disclosure.patch b/patches.drm/0002-omap2fb-Fix-stack-memory-disclosure.patch
new file mode 100644
index 0000000000..bce650331e
--- /dev/null
+++ b/patches.drm/0002-omap2fb-Fix-stack-memory-disclosure.patch
@@ -0,0 +1,44 @@
+From a01421e4484327fe44f8e126793ed5a48a221e24 Mon Sep 17 00:00:00 2001
+From: Vlad Tsyrklevich <vlad@tsyrklevich.net>
+Date: Fri, 11 Jan 2019 14:34:38 +0100
+Subject: omap2fb: Fix stack memory disclosure
+Git-commit: a01421e4484327fe44f8e126793ed5a48a221e24
+Patch-mainline: v5.0-rc3
+References: bsc#1120902
+
+Using [1] for static analysis I found that the OMAPFB_QUERY_PLANE,
+OMAPFB_GET_COLOR_KEY, OMAPFB_GET_DISPLAY_INFO, and OMAPFB_GET_VRAM_INFO
+cases could all leak uninitialized stack memory--either due to
+uninitialized padding or 'reserved' fields.
+
+Fix them by clearing the shared union used to store copied out data.
+
+[1] https://github.com/vlad902/kernel-uninitialized-memory-checker
+
+Signed-off-by: Vlad Tsyrklevich <vlad@tsyrklevich.net>
+Reviewed-by: Kees Cook <keescook@chromium.org>
+Fixes: b39a982ddecf ("OMAP: DSS2: omapfb driver")
+Cc: security@kernel.org
+[b.zolnierkie: prefix patch subject with "omap2fb: "]
+Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
+Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
+---
+ drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c
+index a3edb20ea4c3..a846d32ee653 100644
+--- a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c
+@@ -609,6 +609,8 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+
+ int r = 0;
+
++ memset(&p, 0, sizeof(p));
++
+ switch (cmd) {
+ case OMAPFB_SYNC_GFX:
+ DBG("ioctl SYNC_GFX\n");
+--
+2.20.1
+
diff --git a/patches.fixes/acpi-nfit-fix-race-accessing-memdev-in-nfit_get_smbios_id.patch b/patches.fixes/acpi-nfit-fix-race-accessing-memdev-in-nfit_get_smbios_id.patch
new file mode 100644
index 0000000000..500be5bba7
--- /dev/null
+++ b/patches.fixes/acpi-nfit-fix-race-accessing-memdev-in-nfit_get_smbios_id.patch
@@ -0,0 +1,49 @@
+From: Tony Luck <tony.luck@intel.com>
+Date: Fri, 11 Jan 2019 14:46:37 -0800
+Subject: acpi/nfit: Fix race accessing memdev in nfit_get_smbios_id()
+Git-commit: 0919871ac37fdcf46c7657da0f1742efe096b399
+Patch-mainline: v5.0-rc3
+References: bsc#1122662
+
+Possible race accessing memdev structures after dropping the
+mutex. Dan Williams says this could race against another thread
+that is doing:
+
+ # echo "ACPI0012:00" > /sys/bus/acpi/drivers/nfit/unbind
+
+Reported-by: Jane Chu <jane.chu@oracle.com>
+Fixes: 23222f8f8dce ("acpi, nfit: Add function to look up nvdimm...")
+Signed-off-by: Tony Luck <tony.luck@intel.com>
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ drivers/acpi/nfit/core.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
+index 4ae953a5aebf..790691d9a982 100644
+--- a/drivers/acpi/nfit/core.c
++++ b/drivers/acpi/nfit/core.c
+@@ -714,6 +714,7 @@ int nfit_get_smbios_id(u32 device_handle, u16 *flags)
+ struct acpi_nfit_memory_map *memdev;
+ struct acpi_nfit_desc *acpi_desc;
+ struct nfit_mem *nfit_mem;
++ u16 physical_id;
+
+ mutex_lock(&acpi_desc_lock);
+ list_for_each_entry(acpi_desc, &acpi_descs, list) {
+@@ -721,10 +722,11 @@ int nfit_get_smbios_id(u32 device_handle, u16 *flags)
+ list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) {
+ memdev = __to_nfit_memdev(nfit_mem);
+ if (memdev->device_handle == device_handle) {
++ *flags = memdev->flags;
++ physical_id = memdev->physical_id;
+ mutex_unlock(&acpi_desc->init_mutex);
+ mutex_unlock(&acpi_desc_lock);
+- *flags = memdev->flags;
+- return memdev->physical_id;
++ return physical_id;
+ }
+ }
+ mutex_unlock(&acpi_desc->init_mutex);
+
diff --git a/patches.fixes/blkdev-avoid-migration-stalls-for-blkdev-pages.patch b/patches.fixes/blkdev-avoid-migration-stalls-for-blkdev-pages.patch
new file mode 100644
index 0000000000..a4b2e6b167
--- /dev/null
+++ b/patches.fixes/blkdev-avoid-migration-stalls-for-blkdev-pages.patch
@@ -0,0 +1,46 @@
+From 88dbcbb3a4847f5e6dfeae952d3105497700c128 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Fri, 28 Dec 2018 00:39:16 -0800
+Subject: [PATCH] blkdev: avoid migration stalls for blkdev pages
+Git-commit: 88dbcbb3a4847f5e6dfeae952d3105497700c128
+Patch-mainline: v4.21-rc1
+References: bsc#1084216
+
+Currently, block device pages don't provide a ->migratepage callback and
+thus fallback_migrate_page() is used for them. This handler cannot deal
+with dirty pages in async mode and also with the case a buffer head is in
+the LRU buffer head cache (as it has elevated b_count). Thus such page
+can block memory offlining.
+
+Fix the problem by using buffer_migrate_page_norefs() for migrating block
+device pages. That function takes care of dropping bh LRU in case
+migration would fail due to elevated buffer refcount to avoid stalls and
+can also migrate dirty pages without writing them.
+
+Link: http://lkml.kernel.org/r/20181211172143.7358-6-jack@suse.cz
+Signed-off-by: Jan Kara <jack@suse.cz>
+Acked-by: Mel Gorman <mgorman@suse.de>
+Cc: Michal Hocko <mhocko@suse.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Acked-by: Jan Kara <jack@suse.cz>
+
+---
+ fs/block_dev.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/fs/block_dev.c b/fs/block_dev.c
+index a80b4f0ee7c4..de2135178e62 100644
+--- a/fs/block_dev.c
++++ b/fs/block_dev.c
+@@ -1966,6 +1966,7 @@ static const struct address_space_operations def_blk_aops = {
+ .writepages = blkdev_writepages,
+ .releasepage = blkdev_releasepage,
+ .direct_IO = blkdev_direct_IO,
++ .migratepage = buffer_migrate_page_norefs,
+ .is_dirty_writeback = buffer_check_dirty_writeback,
+ };
+
+--
+2.16.4
+
diff --git a/patches.fixes/mm-migrate-Make-buffer_migrate_page_norefs-actually-.patch b/patches.fixes/mm-migrate-Make-buffer_migrate_page_norefs-actually-.patch
new file mode 100644
index 0000000000..4d7a160ebd
--- /dev/null
+++ b/patches.fixes/mm-migrate-Make-buffer_migrate_page_norefs-actually-.patch
@@ -0,0 +1,62 @@
+From: Jan Kara <jack@suse.cz>
+Date: Wed, 16 Jan 2019 11:02:48 +0100
+Subject: [PATCH] mm: migrate: Make buffer_migrate_page_norefs() actually succeed
+References: bsc#1084216
+Patch-mainline: No, submitted Jan 16 2019
+
+Currently, buffer_migrate_page_norefs() was constantly failing because
+buffer_migrate_lock_buffers() grabbed reference on each buffer. In fact,
+there's no reason for buffer_migrate_lock_buffers() to grab any buffer
+references as the page is locked during all our operation and thus
+nobody can reclaim buffers from the page. So remove grabbing of buffer
+references which also makes buffer_migrate_page_norefs() succeed.
+
+Fixes: 89cb0888ca14 "mm: migrate: provide buffer_migrate_page_norefs()"
+Signed-off-by: Jan Kara <jack@suse.cz>
+Acked-by: Jan Kara <jack@suse.cz>
+---
+ mm/migrate.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/mm/migrate.c b/mm/migrate.c
+index a16b15090df3..712b231a7376 100644
+--- a/mm/migrate.c
++++ b/mm/migrate.c
+@@ -709,7 +709,6 @@ static bool buffer_migrate_lock_buffers(struct buffer_head *head,
+ /* Simple case, sync compaction */
+ if (mode != MIGRATE_ASYNC) {
+ do {
+- get_bh(bh);
+ lock_buffer(bh);
+ bh = bh->b_this_page;
+
+@@ -720,18 +719,15 @@ static bool buffer_migrate_lock_buffers(struct buffer_head *head,
+
+ /* async case, we cannot block on lock_buffer so use trylock_buffer */
+ do {
+- get_bh(bh);
+ if (!trylock_buffer(bh)) {
+ /*
+ * We failed to lock the buffer and cannot stall in
+ * async migration. Release the taken locks
+ */
+ struct buffer_head *failed_bh = bh;
+- put_bh(failed_bh);
+ bh = head;
+ while (bh != failed_bh) {
+ unlock_buffer(bh);
+- put_bh(bh);
+ bh = bh->b_this_page;
+ }
+ return false;
+@@ -818,7 +814,6 @@ static int __buffer_migrate_page(struct address_space *mapping,
+ bh = head;
+ do {
+ unlock_buffer(bh);
+- put_bh(bh);
+ bh = bh->b_this_page;
+
+ } while (bh != head);
+--
+2.16.4
+
diff --git a/patches.fixes/mm-migrate-lock-buffers-before-migrate_page_move_map.patch b/patches.fixes/mm-migrate-lock-buffers-before-migrate_page_move_map.patch
new file mode 100644
index 0000000000..12ad04167e
--- /dev/null
+++ b/patches.fixes/mm-migrate-lock-buffers-before-migrate_page_move_map.patch
@@ -0,0 +1,79 @@
+From cc4f11e69fd00c61c38619759b07d00631bda5ca Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Fri, 28 Dec 2018 00:39:05 -0800
+Subject: [PATCH] mm: migrate: lock buffers before migrate_page_move_mapping()
+Git-commit: cc4f11e69fd00c61c38619759b07d00631bda5ca
+Patch-mainline: v4.21-rc1
+References: bsc#1084216
+
+Lock buffers before calling into migrate_page_move_mapping() so that that
+function doesn't have to know about buffers (which is somewhat unexpected
+anyway) and all the buffer head logic is in buffer_migrate_page().
+
+Link: http://lkml.kernel.org/r/20181211172143.7358-3-jack@suse.cz
+Signed-off-by: Jan Kara <jack@suse.cz>
+Acked-by: Mel Gorman <mgorman@suse.de>
+Cc: Michal Hocko <mhocko@suse.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Acked-by: Jan Kara <jack@suse.cz>
+
+---
+ mm/migrate.c | 25 +++++++++++++------------
+ 1 file changed, 13 insertions(+), 12 deletions(-)
+
+--- a/mm/migrate.c
++++ b/mm/migrate.c
+@@ -743,24 +743,23 @@ int buffer_migrate_page(struct address_s
+ {
+ struct buffer_head *bh, *head;
+ int rc;
++ int expected_count;
+
+ if (!page_has_buffers(page))
+ return migrate_page(mapping, newpage, page, mode);
+
+- head = page_buffers(page);
++ /* Check whether page does not have extra refs before we do more work */
++ expected_count = expected_page_refs(page);
++ if (page_count(page) != expected_count)
++ return -EAGAIN;
+
+- rc = migrate_page_move_mapping(mapping, newpage, page, head, mode, 0);
++ head = page_buffers(page);
++ if (!buffer_migrate_lock_buffers(head, mode))
++ return -EAGAIN;
+
++ rc = migrate_page_move_mapping(mapping, newpage, page, NULL, mode, 0);
+ if (rc != MIGRATEPAGE_SUCCESS)
+- return rc;
+-
+- /*
+- * In the async case, migrate_page_move_mapping locked the buffers
+- * with an IRQ-safe spinlock held. In the sync case, the buffers
+- * need to be locked now
+- */
+- if (mode != MIGRATE_ASYNC)
+- BUG_ON(!buffer_migrate_lock_buffers(head, mode));
++ goto unlock_buffers;
+
+ ClearPagePrivate(page);
+ set_page_private(newpage, page_private(page));
+@@ -782,6 +781,8 @@ int buffer_migrate_page(struct address_s
+ else
+ migrate_page_states(newpage, page);
+
++ rc = MIGRATEPAGE_SUCCESS;
++unlock_buffers:
+ bh = head;
+ do {
+ unlock_buffer(bh);
+@@ -790,7 +791,7 @@ int buffer_migrate_page(struct address_s
+
+ } while (bh != head);
+
+- return MIGRATEPAGE_SUCCESS;
++ return rc;
+ }
+ EXPORT_SYMBOL(buffer_migrate_page);
+ #endif
diff --git a/patches.fixes/mm-migrate-provide-buffer_migrate_page_norefs.patch b/patches.fixes/mm-migrate-provide-buffer_migrate_page_norefs.patch
new file mode 100644
index 0000000000..4d8f07f172
--- /dev/null
+++ b/patches.fixes/mm-migrate-provide-buffer_migrate_page_norefs.patch
@@ -0,0 +1,125 @@
+From 89cb0888ca1483ad72648844ddd1b801863a8949 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Fri, 28 Dec 2018 00:39:12 -0800
+Subject: [PATCH] mm: migrate: provide buffer_migrate_page_norefs()
+Git-commit: 89cb0888ca1483ad72648844ddd1b801863a8949
+Patch-mainline: v4.21-rc1
+References: bsc#1084216
+
+Provide a variant of buffer_migrate_page() that also checks whether there
+are no unexpected references to buffer heads. This function will then be
+safe to use for block device pages.
+
+[akpm@linux-foundation.org: remove EXPORT_SYMBOL(buffer_migrate_page_norefs)]
+Link: http://lkml.kernel.org/r/20181211172143.7358-5-jack@suse.cz
+Signed-off-by: Jan Kara <jack@suse.cz>
+Acked-by: Mel Gorman <mgorman@suse.de>
+Cc: Michal Hocko <mhocko@suse.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Acked-by: Jan Kara <jack@suse.cz>
+
+---
+ include/linux/fs.h | 4 +++
+ mm/migrate.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 57 insertions(+), 7 deletions(-)
+
+--- a/include/linux/fs.h
++++ b/include/linux/fs.h
+@@ -3109,8 +3109,12 @@ extern int generic_check_addressable(uns
+ extern int buffer_migrate_page(struct address_space *,
+ struct page *, struct page *,
+ enum migrate_mode);
++extern int buffer_migrate_page_norefs(struct address_space *,
++ struct page *, struct page *,
++ enum migrate_mode);
+ #else
+ #define buffer_migrate_page NULL
++#define buffer_migrate_page_norefs NULL
+ #endif
+
+ extern int setattr_prepare(struct dentry *, struct iattr *);
+--- a/mm/migrate.c
++++ b/mm/migrate.c
+@@ -733,13 +733,9 @@ int migrate_page(struct address_space *m
+ EXPORT_SYMBOL(migrate_page);
+
+ #ifdef CONFIG_BLOCK
+-/*
+- * Migration function for pages with buffers. This function can only be used
+- * if the underlying filesystem guarantees that no other references to "page"
+- * exist.
+- */
+-int buffer_migrate_page(struct address_space *mapping,
+- struct page *newpage, struct page *page, enum migrate_mode mode)
++static int __buffer_migrate_page(struct address_space *mapping,
++ struct page *newpage, struct page *page, enum migrate_mode mode,
++ bool check_refs)
+ {
+ struct buffer_head *bh, *head;
+ int rc;
+@@ -757,6 +753,33 @@ int buffer_migrate_page(struct address_s
+ if (!buffer_migrate_lock_buffers(head, mode))
+ return -EAGAIN;
+
++ if (check_refs) {
++ bool busy;
++ bool invalidated = false;
++
++recheck_buffers:
++ busy = false;
++ spin_lock(&mapping->private_lock);
++ bh = head;
++ do {
++ if (atomic_read(&bh->b_count)) {
++ busy = true;
++ break;
++ }
++ bh = bh->b_this_page;
++ } while (bh != head);
++ spin_unlock(&mapping->private_lock);
++ if (busy) {
++ if (invalidated) {
++ rc = -EAGAIN;
++ goto unlock_buffers;
++ }
++ invalidate_bh_lrus();
++ invalidated = true;
++ goto recheck_buffers;
++ }
++ }
++
+ rc = migrate_page_move_mapping(mapping, newpage, page, NULL, mode, 0);
+ if (rc != MIGRATEPAGE_SUCCESS)
+ goto unlock_buffers;
+@@ -793,7 +816,30 @@ unlock_buffers:
+
+ return rc;
+ }
++
++/*
++ * Migration function for pages with buffers. This function can only be used
++ * if the underlying filesystem guarantees that no other references to "page"
++ * exist. For example attached buffer heads are accessed only under page lock.
++ */
++int buffer_migrate_page(struct address_space *mapping,
++ struct page *newpage, struct page *page, enum migrate_mode mode)
++{
++ return __buffer_migrate_page(mapping, newpage, page, mode, false);
++}
+ EXPORT_SYMBOL(buffer_migrate_page);
++
++/*
++ * Same as above except that this variant is more careful and checks that there
++ * are also no buffer head references. This function is the right one for
++ * mappings where buffer heads are directly looked up and referenced (such as
++ * block device mappings).
++ */
++int buffer_migrate_page_norefs(struct address_space *mapping,
++ struct page *newpage, struct page *page, enum migrate_mode mode)
++{
++ return __buffer_migrate_page(mapping, newpage, page, mode, true);
++}
+ #endif
+
+ /*
diff --git a/patches.fixes/mm-migration-factor-out-code-to-compute-expected-num.patch b/patches.fixes/mm-migration-factor-out-code-to-compute-expected-num.patch
new file mode 100644
index 0000000000..afc412ecd0
--- /dev/null
+++ b/patches.fixes/mm-migration-factor-out-code-to-compute-expected-num.patch
@@ -0,0 +1,92 @@
+From 0b3901b38d9d916f634e903ce7cd2a8ddd5b1559 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Fri, 28 Dec 2018 00:39:01 -0800
+Subject: [PATCH] mm: migration: factor out code to compute expected number of
+ page references
+Git-commit: 0b3901b38d9d916f634e903ce7cd2a8ddd5b1559
+Patch-mainline: v4.21-rc1
+References: bsc#1084216
+
+Patch series "mm: migrate: Fix page migration stalls for blkdev pages".
+
+This patchset deals with page migration stalls that were reported by our
+customer due to a block device page that had a bufferhead that was in the
+bh LRU cache.
+
+The patchset modifies the page migration code so that bufferheads are
+completely handled inside buffer_migrate_page() and then provides a new
+migration helper for pages with buffer heads that is safe to use even for
+block device pages and that also deals with bh lrus.
+
+This patch (of 6):
+
+Factor out function to compute number of expected page references in
+migrate_page_move_mapping(). Note that we move hpage_nr_pages() and
+page_has_private() checks from under xas_lock_irq() however this is safe
+since we hold page lock.
+
+[jack@suse.cz: fix expected_page_refs()]
+ Link: http://lkml.kernel.org/r/20181217131710.GB8611@quack2.suse.cz
+Link: http://lkml.kernel.org/r/20181211172143.7358-2-jack@suse.cz
+Signed-off-by: Jan Kara <jack@suse.cz>
+Acked-by: Mel Gorman <mgorman@suse.de>
+Cc: Michal Hocko <mhocko@suse.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Acked-by: Jan Kara <jack@suse.cz>
+
+---
+ mm/migrate.c | 26 +++++++++++++++++---------
+ 1 file changed, 17 insertions(+), 9 deletions(-)
+
+--- a/mm/migrate.c
++++ b/mm/migrate.c
+@@ -392,6 +392,22 @@ static inline bool buffer_migrate_lock_b
+ }
+ #endif /* CONFIG_BLOCK */
+
++static int expected_page_refs(struct page *page)
++{
++ int expected_count = 1;
++
++ /*
++ * Device public or private pages have an extra refcount as they are
++ * ZONE_DEVICE pages.
++ */
++ expected_count += is_device_private_page(page);
++ expected_count += is_device_public_page(page);
++ if (page_mapping(page))
++ expected_count += 1 + page_has_private(page);
++
++ return expected_count;
++}
++
+ /*
+ * Replace the page in the mapping.
+ *
+@@ -407,16 +423,9 @@ int migrate_page_move_mapping(struct add
+ {
+ struct zone *oldzone, *newzone;
+ int dirty;
+- int expected_count = 1 + extra_count;
++ int expected_count = expected_page_refs(page) + extra_count;
+ void **pslot;
+
+- /*
+- * Device public or private pages have an extra refcount as they are
+- * ZONE_DEVICE pages.
+- */
+- expected_count += is_device_private_page(page);
+- expected_count += is_device_public_page(page);
+-
+ if (!mapping) {
+ /* Anonymous page without mapping */
+ if (page_count(page) != expected_count)
+@@ -439,7 +448,6 @@ int migrate_page_move_mapping(struct add
+ pslot = radix_tree_lookup_slot(&mapping->page_tree,
+ page_index(page));
+
+- expected_count += 1 + page_has_private(page);
+ if (page_count(page) != expected_count ||
+ radix_tree_deref_slot_protected(pslot, &mapping->tree_lock) != page) {
+ spin_unlock_irq(&mapping->tree_lock);
diff --git a/patches.suse/drm-i915-CFL-NVMe-breakage-workaround.patch b/patches.suse/drm-i915-CFL-NVMe-breakage-workaround.patch
deleted file mode 100644
index fe5ac0cf40..0000000000
--- a/patches.suse/drm-i915-CFL-NVMe-breakage-workaround.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From: Takashi Iwai <tiwai@suse.de>
-Subject: Workaround for mysterious NVMe breakage with i915 CFL
-Patch-mainline: Never, a temporary workaround
-References: bsc#1111040
-
-A temporary workaround for a new CFL that breaks NVMe by some reason
-at detecting the non-existing HDMI-3 port.
-
-This should be removed once when it gets fixed properly in the upstream
-code.
-
-Signed-off-by: Takashi Iwai <tiwai@suse.de>
-
----
- drivers/gpu/drm/i915/intel_bios.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
---- a/drivers/gpu/drm/i915/intel_bios.c
-+++ b/drivers/gpu/drm/i915/intel_bios.c
-@@ -2031,11 +2031,17 @@ intel_bios_is_lspcon_present(struct drm_
- enum port port)
- {
- const struct child_device_config *child;
-+ struct pci_dev *pdev = dev_priv->drm.pdev;
- int i;
-
- if (!HAS_LSPCON(dev_priv))
- return false;
-
-+ // XXX: workaround for a buggy Intel board (bsc#1111040)
-+ if (pdev->subsystem_vendor == 0x8086 &&
-+ pdev->subsystem_device == 0x2212)
-+ return true;
-+
- for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
- child = dev_priv->vbt.child_dev + i;
-
diff --git a/scripts/git_sort/quilt-mode.sh b/scripts/git_sort/quilt-mode.sh
index b6ab09c380..99aae1b874 100644
--- a/scripts/git_sort/quilt-mode.sh
+++ b/scripts/git_sort/quilt-mode.sh
@@ -257,7 +257,7 @@ qadd () {
(
[ ${#series[@]} -gt 0 ] && printf "%s\n" "${series[@]}"
[ -n "$_series" ] && echo "$_series"
- ) | GIT_DIR=$git_dir "$_libdir"/git-sort
+ ) | GIT_DIR=$git_dir "$_libdir"/git_sort.py
)"
if [ -z "${series[0]}" ]; then
@@ -281,7 +281,7 @@ qedit () {
${EDITOR:-${VISUAL:-vi}} "$tmpfile"
mapfile -t series <<< "$(grep . "$tmpfile" |
- GIT_DIR=$git_dir $_libdir/git-sort)"
+ GIT_DIR=$git_dir $_libdir/git_sort.py)"
if [ -z "${series[0]}" ]; then
unset series[0]
diff --git a/scripts/git_sort/series_sort.py b/scripts/git_sort/series_sort.py
index ae50761a97..7fbfbcb9b0 100755
--- a/scripts/git_sort/series_sort.py
+++ b/scripts/git_sort/series_sort.py
@@ -67,22 +67,31 @@ if __name__ == "__main__":
"as appropriate. Default: false.")
parser.add_argument("series", nargs="?", metavar="series.conf",
help="series.conf file which will be modified in "
- "place. Default: read input from stdin.")
+ "place. Default: if stdin is a terminal, "
+ "\"series.conf\"; otherwise, read input from stdin.")
args = parser.parse_args()
repo_path = lib.repo_path()
repo = pygit2.Repository(repo_path)
index = git_sort.SortIndex(repo)
- if args.series is not None:
+ filter_mode = False
+ if args.series is None:
+ if sys.stdin.isatty():
+ path = "series.conf"
+ else:
+ filter_mode = True
+ else:
+ path = args.series
+ if filter_mode:
+ f = sys.stdin
+ else:
try:
- f = open(args.series)
+ f = open(path)
except FileNotFoundError as err:
print("Error: %s" % (err,), file=sys.stderr)
sys.exit(1)
- series = os.path.abspath(args.series)
- else:
- f = sys.stdin
+ series_path = os.path.abspath(path)
lines = f.readlines()
if args.prefix is not None:
@@ -91,7 +100,7 @@ if __name__ == "__main__":
try:
before, inside, after = series_conf.split(lines)
except exc.KSNotFound as err:
- if args.series is None:
+ if filter_mode:
before = []
inside = lines
after = []
@@ -137,10 +146,10 @@ if __name__ == "__main__":
after,
])
- if args.series is not None:
- f = open(series, mode="w")
- else:
+ if filter_mode:
f = sys.stdout
+ else:
+ f = open(series_path, mode="w")
f.writelines(output)
try:
lib.update_tags(index, to_update)
diff --git a/scripts/python/tests/test_header.py b/scripts/python/tests/test_header.py
index 0b80a27ed1..003c0c84d9 100755
--- a/scripts/python/tests/test_header.py
+++ b/scripts/python/tests/test_header.py
@@ -8,32 +8,17 @@ from io import StringIO
from suse_git import header
-# You'll see a slightly strange pattern here:
-# try:
-# self.sometest()
-# self.assertTrue(False)
-# except Exception, e:
-# rest of test
-#
-# This is to test the exception contents. Python's unittest module
-# allows us to assert that a particular exception is raised but
-# it won't let us inspect the contents of it. The assertTrue(False)
-# will cause a test failure if an exception isn't raised; The
-# except HeaderException clause will cause a test failure if the
-# exception isn't HeaderException. When adding new test cases,
-# please follow this pattern when the test case is expecting to fail.
-
class TestHeaderChecker(unittest.TestCase):
def test_empty(self):
try:
self.header = header.Checker("")
except header.HeaderException as e:
- self.assertTrue(e.errors(header.MissingTagError) == 4)
+ self.assertEqual(4, e.errors(header.MissingTagError))
self.assertTrue(e.tag_is_missing('patch-mainline'))
self.assertTrue(e.tag_is_missing('from'))
self.assertTrue(e.tag_is_missing('subject'))
self.assertTrue(e.tag_is_missing('references'))
- self.assertTrue(e.errors() == 4)
+ self.assertEqual(4, e.errors())
def test_subject_dupe(self):
text = """
@@ -45,12 +30,11 @@ Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.DuplicateTagError) == 1)
- self.assertTrue(e.errors() == 1)
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.DuplicateTagError))
+ self.assertEqual(1, e.errors())
def test_patch_mainline_dupe(self):
text = """
@@ -62,12 +46,12 @@ Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.DuplicateTagError) == 1)
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.DuplicateTagError))
+ self.assertEqual(1, e.errors())
def test_patch_mainline_empty(self):
text = """
@@ -77,14 +61,14 @@ Patch-mainline:
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.EmptyTagError) == 1)
- self.assertTrue(e.errors(header.MissingTagError) == 1)
- self.assertTrue(e.tag_is_missing('patch-mainline'))
- self.assertTrue(e.errors() == 2)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.EmptyTagError))
+ self.assertEqual(1, e.errors(header.MissingTagError))
+ self.assertTrue(e.tag_is_missing('patch-mainline'))
+ self.assertEqual(2, e.errors())
def test_patch_mainline_version_no_ack_or_sob(self):
text = """
@@ -98,10 +82,10 @@ Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
try:
self.header = header.Checker(text)
except header.HeaderException as e:
- self.assertTrue(e.errors(header.MissingTagError) == 1)
+ self.assertEqual(1, e.errors(header.MissingTagError))
self.assertTrue(e.tag_is_missing('acked-by'))
self.assertTrue(e.tag_is_missing('signed-off-by'))
- self.assertTrue(e.errors() == 1)
+ self.assertEqual(1, e.errors())
def test_patch_mainline_version_correct_multi_ack(self):
text = """
@@ -215,12 +199,12 @@ Patch-mainline: n/a
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.FormatError) == 1)
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.FormatError))
+ self.assertEqual(1, e.errors())
def test_patch_mainline_submitted_correct_ml(self):
text = """
@@ -250,12 +234,12 @@ Patch-mainline: Submitted
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.FormatError) == 1)
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.FormatError))
+ self.assertEqual(1, e.errors())
def test_patch_mainline_submitted_detail_git_commit(self):
text = """
@@ -266,12 +250,12 @@ Git-repo: git://host/valid/path/to/repo
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.ExcludedTagError) == 1)
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.ExcludedTagError))
+ self.assertEqual(1, e.errors())
# Required/Excluded conflict between Patch-mainline (Submitted)
# and Git-commit
@@ -284,13 +268,13 @@ Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.MissingTagError) == 1)
- self.assertTrue(e.errors(header.ExcludedTagError) == 1)
- self.assertTrue(e.errors() == 2)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.MissingTagError))
+ self.assertEqual(1, e.errors(header.ExcludedTagError))
+ self.assertEqual(2, e.errors())
def test_patch_mainline_submitted_no_detail(self):
text = """
@@ -300,12 +284,12 @@ Patch-mainline: Submitted
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.FormatError) == 1)
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.FormatError))
+ self.assertEqual(1, e.errors())
def test_patch_mainline_never_no_detail(self):
text = """
@@ -318,8 +302,8 @@ Acked-by: developer@suse.com
try:
self.header = header.Checker(text)
except header.HeaderException as e:
- self.assertTrue(e.errors(header.FormatError) == 1)
- self.assertTrue(e.errors() == 1)
+ self.assertEqual(1, e.errors(header.FormatError))
+ self.assertEqual(1, e.errors())
def test_patch_mainline_yes_with_detail(self):
text = """
@@ -329,12 +313,12 @@ Patch-mainline: Yes, v4.1-rc1
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.FormatError) == 1)
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.FormatError))
+ self.assertEqual(1, e.errors())
def test_patch_mainline_yes_no_detail(self):
text = """
@@ -344,12 +328,12 @@ Patch-mainline: Yes
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.FormatError) == 1)
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.FormatError))
+ self.assertEqual(1, e.errors())
def test_patch_mainline_not_yet_no_detail(self):
text = """
@@ -359,12 +343,12 @@ Patch-mainline: Not yet
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.FormatError) == 1)
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.FormatError))
+ self.assertEqual(1, e.errors())
def test_patch_mainline_never_detail(self):
text = """
@@ -408,9 +392,9 @@ Acked-by: developer@suse.com
self.header = header.Checker(text)
except header.HeaderException as e:
# Both policy and Git-commit require Patch-mainline
- self.assertTrue(e.errors(header.MissingTagError) == 2)
+ self.assertEqual(2, e.errors(header.MissingTagError))
self.assertTrue(e.tag_is_missing('patch-mainline'))
- self.assertTrue(e.errors() == 2)
+ self.assertEqual(2, e.errors())
def test_patch_mainline_queued_correct(self):
text = """
@@ -432,14 +416,14 @@ Patch-mainline: Queued
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.MissingTagError) == 2)
- self.assertTrue(e.tag_is_missing('git-commit'))
- self.assertTrue(e.tag_is_missing('git-repo'))
- self.assertTrue(e.errors() == 2)
+
+ e = cm.exception
+ self.assertEqual(2, e.errors(header.MissingTagError))
+ self.assertTrue(e.tag_is_missing('git-commit'))
+ self.assertTrue(e.tag_is_missing('git-repo'))
+ self.assertEqual(2, e.errors())
def test_patch_mainline_queued_with_git_repo(self):
text = """
@@ -450,15 +434,15 @@ Git-repo: git://path/to/git/repo
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- # Required by both Patch-mainline (Queued) and
- # Git-repo
- self.assertTrue(e.errors(header.MissingTagError) == 2)
- self.assertTrue(e.tag_is_missing('git-commit'))
- self.assertTrue(e.errors() == 2)
+
+ e = cm.exception
+ # Required by both Patch-mainline (Queued) and
+ # Git-repo
+ self.assertEqual(2, e.errors(header.MissingTagError))
+ self.assertTrue(e.tag_is_missing('git-commit'))
+ self.assertEqual(2, e.errors())
def test_patch_mainline_queued_with_git_commit(self):
text = """
@@ -469,13 +453,13 @@ Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.MissingTagError) == 1)
- self.assertTrue(e.tag_is_missing('git-repo'))
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.MissingTagError))
+ self.assertTrue(e.tag_is_missing('git-repo'))
+ self.assertEqual(1, e.errors())
def test_patch_mainline_invalid(self):
text = """
@@ -485,12 +469,12 @@ Patch-mainline: n/a
References: bsc#12345
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.FormatError) == 1)
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.FormatError))
+ self.assertEqual(1, e.errors())
def test_diff_like_description(self):
text = """
@@ -531,14 +515,14 @@ Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
References:
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.EmptyTagError) == 1)
- self.assertTrue(e.errors(header.MissingTagError) == 1)
- self.assertTrue(e.tag_is_missing('references'))
- self.assertTrue(e.errors() == 2)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.EmptyTagError))
+ self.assertEqual(1, e.errors(header.MissingTagError))
+ self.assertTrue(e.tag_is_missing('references'))
+ self.assertEqual(2, e.errors())
def test_patch_references_missing(self):
text = """
@@ -548,13 +532,13 @@ Patch-mainline: v4.2-rc1
Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.MissingTagError) == 1)
- self.assertTrue(e.tag_is_missing('references'))
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.MissingTagError))
+ self.assertTrue(e.tag_is_missing('references'))
+ self.assertEqual(1, e.errors())
def test_patch_references_multi(self):
text = """
@@ -604,24 +588,26 @@ Acked-by: developer@suse.com
self.header = header.Checker(text)
-# Enable this check when we want to require a real References tag
-# def test_patch_references_only_freeform(self):
-# text = """
-#From: developer@site.com
-#Subject: some patch
-#Patch-mainline: v4.2-rc1
-#Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-#References: fix for blahblah
-#Acked-by: developer@suse.com
-#"""
-# try:
-# self.header = header.Checker(text)
-# self.assertTrue(False)
-# except header.HeaderException, e:
-# self.assertTrue(e.errors(header.MissingTagError) == 1)
-# self.assertTrue(e.tag_is_missing('references'))
-# self.assertTrue(e.errors() == 1)
-#
+
+ @unittest.skip("Enable this check when we want to require a real "
+ "References tag")
+ def test_patch_references_only_freeform(self):
+ text = """
+From: developer@site.com
+Subject: some patch
+Patch-mainline: v4.2-rc1
+Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+References: fix for blahblah
+Acked-by: developer@suse.com
+"""
+ with self.assertRaises(header.HeaderException) as cm:
+ self.header = header.Checker(text)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.MissingTagError))
+ self.assertTrue(e.tag_is_missing('references'))
+ self.assertEqual(1, e.errors())
+
def test_patch_references_empty_update(self):
text = """
@@ -632,12 +618,12 @@ Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
References:
Acked-by: developer@suse.com
"""
- try:
+ with self.assertRaises(header.HeaderException) as cm:
self.header = header.Checker(text, True)
- self.assertTrue(False)
- except header.HeaderException as e:
- self.assertTrue(e.errors(header.EmptyTagError) == 1)
- self.assertTrue(e.errors() == 1)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.EmptyTagError))
+ self.assertEqual(1, e.errors())
def test_patch_references_missing_update(self):
text = """
@@ -697,21 +683,21 @@ Acked-by: developer@suse.com
self.header = header.Checker(text, True)
-# Enable this check when we want to require a real References tag
-# def test_patch_references_only_freeform_update(self):
-# text = """
-#From: developer@site.com
-#Subject: some patch
-#Patch-mainline: v4.2-rc1
-#Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-#References: fix for blahblah
-#Acked-by: developer@suse.com
-#"""
-# try:
-# self.header = header.Checker(text, True)
-# self.assertTrue(False)
-# except header.HeaderException, e:
-# self.assertTrue(e.errors(header.MissingTagError) == 1)
-# self.assertTrue(e.tag_is_missing('references'))
-# self.assertTrue(e.errors() == 1)
-#
+ @unittest.skip("Enable this check when we want to require a real "
+ "References tag")
+ def test_patch_references_only_freeform_update(self):
+ text = """
+From: developer@site.com
+Subject: some patch
+Patch-mainline: v4.2-rc1
+Git-commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+References: fix for blahblah
+Acked-by: developer@suse.com
+"""
+ with self.assertRaises(header.HeaderException) as cm:
+ self.header = header.Checker(text, True)
+
+ e = cm.exception
+ self.assertEqual(1, e.errors(header.MissingTagError))
+ self.assertTrue(e.tag_is_missing('references'))
+ self.assertEqual(1, e.errors())
diff --git a/scripts/tar-up.sh b/scripts/tar-up.sh
index 90c3f3ab0a..9e5ece204b 100755
--- a/scripts/tar-up.sh
+++ b/scripts/tar-up.sh
@@ -195,8 +195,9 @@ CLEANFILES=()
trap 'if test -n "$CLEANFILES"; then rm -rf "${CLEANFILES[@]}"; fi' EXIT
tmpdir=$(mktemp -dt ${0##*/}.XXXXXX)
CLEANFILES=("${CLEANFILES[@]}" "$tmpdir")
+rpmfiles=$(ls rpm/* | grep -v "~$")
-cp -p rpm/* config.conf supported.conf doc/* $build_dir
+cp -p $rpmfiles config.conf supported.conf doc/* $build_dir
match="${flavor:+\\/$flavor$}"
match="${arch:+^+\\($(echo -n "${arch}" | sed 's/[, ]\+/\\\|/g')\\)\\>${match:+.*}}${match}"
[ -n "$match" ] && sed -i "/^$\|\s*#\|${match}/b; s/\(.*\)/#### \1/" $build_dir/config.conf
diff --git a/series.conf b/series.conf
index abb26a33ff..2f4f8a3c81 100644
--- a/series.conf
+++ b/series.conf
@@ -19808,6 +19808,10 @@
patches.fixes/0001-mm-only-report-isolation-failures-when-offlining-mem.patch
patches.fixes/mm-put_and_wait_on_page_locked-while-page-is-migrated.patch
patches.fixes/0001-hwpoison-memory_hotplug-allow-hwpoisoned-pages-to-be.patch
+ patches.fixes/mm-migration-factor-out-code-to-compute-expected-num.patch
+ patches.fixes/mm-migrate-lock-buffers-before-migrate_page_move_map.patch
+ patches.fixes/mm-migrate-provide-buffer_migrate_page_norefs.patch
+ patches.fixes/blkdev-avoid-migration-stalls-for-blkdev-pages.patch
patches.drivers/gpiolib-Fix-return-value-of-gpio_to_desc-stub-if-GPI.patch
patches.drivers/power-supply-olpc_battery-correct-the-temperature-un.patch
patches.drivers/usb-dwc2-host-use-hrtimer-for-nak-retries.patch
@@ -19847,9 +19851,13 @@
patches.drivers/ALSA-hda-realtek-Disable-headset-Mic-VREF-for-headse.patch
patches.arch/x86-modpost-replace-last-remnants-of-retpoline-with-config_retpoline.patch
patches.drm/drm-nouveau-Don-t-disable-polling-in-fallback-mode.patch
+ patches.drm/0001-drm-fb-helper-Partially-bring-back-workaround-for-bu.patch
patches.drm/0001-drm-fb-helper-Ignore-the-value-of-fb_var_screeninfo..patch
patches.fixes/kvm-sev-fail-kvm_sev_init-if-already-initialized.patch
patches.drivers/tty-Don-t-hold-ldisc-lock-in-tty_reopen-if-ldisc-pre.patch
+ patches.drm/0001-drm-i915-gvt-Fix-mmap-range-check.patch
+ patches.drm/0002-omap2fb-Fix-stack-memory-disclosure.patch
+ patches.fixes/acpi-nfit-fix-race-accessing-memdev-in-nfit_get_smbios_id.patch
# davem/net-next
patches.suse/msft-hv-1766-hv_netvsc-fix-vf-serial-matching-with-pci-slot-info.patch
@@ -20000,6 +20008,7 @@
patches.kabi/0001-hwpoison-memory_hotplug-allow-hwpoisoned-pages-to-be-kabi.patch
patches.fixes/vfs-Avoid-softlockups-in-drop_pagecache_sb.patch
+ patches.fixes/mm-migrate-Make-buffer_migrate_page_norefs-actually-.patch
########################################################
# misc small fixes
@@ -20220,8 +20229,6 @@
patches.arch/drm-hibmc-Use-set_busid-function-from-drm-core.patch
patches.drm/drm-hibmc-initialize-the-hibmc_bo_driver_io_mem_pfn.patch
- patches.suse/drm-i915-CFL-NVMe-breakage-workaround.patch
-
########################################################
# Out-of-tree networking
########################################################