hulk inclusion category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/15309 -------------------------------- Fix the KABI breakage in 'struct fb_deferred_io' and 'struct fb_info' caused by the commit aa653458e2cc ("fbdev: defio: Disconnect deferred I/O from the lifetime of struct fb_info"). Use the KABI_RESERVE() macro defined within struct work_struct for the queue member of struct fb_info. Fixes: aa653458e2cc ("fbdev: defio: Disconnect deferred I/O from the lifetime of struct fb_info") Signed-off-by: Liu Kai <liukai284@huawei.com> --- drivers/video/fbdev/core/fb_defio.c | 12 ++++++------ include/linux/fb.h | 1 - include/linux/workqueue.h | 4 ++++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/core/fb_defio.c b/drivers/video/fbdev/core/fb_defio.c index 7fc5ff7ec1f6..5b81d2d35398 100644 --- a/drivers/video/fbdev/core/fb_defio.c +++ b/drivers/video/fbdev/core/fb_defio.c @@ -282,9 +282,9 @@ int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma) vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; if (!(info->flags & FBINFO_VIRTFB)) vma->vm_flags |= VM_IO; - vma->vm_private_data = info->fbdefio_state; + vma->vm_private_data = info->queue.fbdefio_state; - fb_deferred_io_state_get(info->fbdefio_state); /* released in vma->vm_ops->close() */ + fb_deferred_io_state_get(info->queue.fbdefio_state); /* released in vma->vm_ops->close() */ return 0; } @@ -297,7 +297,7 @@ static void fb_deferred_io_work(struct work_struct *work) struct list_head *node, *next; struct page *cur; struct fb_deferred_io *fbdefio = info->fbdefio; - struct fb_deferred_io_state *fbdefio_state = info->fbdefio_state; + struct fb_deferred_io_state *fbdefio_state = info->queue.fbdefio_state; /* here we mkclean the pages, then do all deferred IO */ mutex_lock(&fbdefio_state->lock); @@ -333,7 +333,7 @@ void fb_deferred_io_init(struct fb_info *info) if (fbdefio->delay == 0) /* set a default of 1 s */ fbdefio->delay = HZ; - info->fbdefio_state = fbdefio_state; + info->queue.fbdefio_state = fbdefio_state; } EXPORT_SYMBOL_GPL(fb_deferred_io_init); @@ -350,7 +350,7 @@ void fb_deferred_io_cleanup(struct fb_info *info) struct fb_deferred_io *fbdefio = info->fbdefio; struct page *page; int i; - struct fb_deferred_io_state *fbdefio_state = info->fbdefio_state; + struct fb_deferred_io_state *fbdefio_state = info->queue.fbdefio_state; BUG_ON(!fbdefio); cancel_delayed_work_sync(&info->deferred_work); @@ -361,7 +361,7 @@ void fb_deferred_io_cleanup(struct fb_info *info) page->mapping = NULL; } - info->fbdefio_state = NULL; + info->queue.fbdefio_state = NULL; mutex_lock(&fbdefio_state->lock); fbdefio_state->info = NULL; diff --git a/include/linux/fb.h b/include/linux/fb.h index 7cf2c03e83f6..0581576d972f 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -469,7 +469,6 @@ struct fb_info { #ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work; struct fb_deferred_io *fbdefio; - struct fb_deferred_io_state *fbdefio_state; #endif const struct fb_ops *fbops; diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 0ffefea3a557..4fb896d7b839 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -104,7 +104,11 @@ struct work_struct { struct lockdep_map lockdep_map; #endif +#ifdef CONFIG_FB_DEFERRED_IO + KABI_USE(1, struct fb_deferred_io_state *fbdefio_state) +#else KABI_RESERVE(1) +#endif KABI_RESERVE(2) KABI_RESERVE(3) KABI_RESERVE(4) -- 2.34.1