From: Sasha Levin Date: Wed, 10 Feb 2021 18:29:38 +0000 (-0500) Subject: Fixes for 4.19 X-Git-Tag: v4.19.176~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb924e8ed5bc1d214114d8b6e6cbf6362b6d01ac;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/include-trace-events-writeback.h-fix-wstringop-trunc.patch b/queue-4.19/include-trace-events-writeback.h-fix-wstringop-trunc.patch new file mode 100644 index 00000000000..0e1e357e096 --- /dev/null +++ b/queue-4.19/include-trace-events-writeback.h-fix-wstringop-trunc.patch @@ -0,0 +1,191 @@ +From 4d6bb422f2ba417233b5699570ad9aef68464d2f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 25 Sep 2019 16:46:16 -0700 +Subject: include/trace/events/writeback.h: fix -Wstringop-truncation warnings + +From: Qian Cai + +[ Upstream commit d1a445d3b86c9341ce7a0954c23be0edb5c9bec5 ] + +There are many of those warnings. + +In file included from ./arch/powerpc/include/asm/paca.h:15, + from ./arch/powerpc/include/asm/current.h:13, + from ./include/linux/thread_info.h:21, + from ./include/asm-generic/preempt.h:5, + from ./arch/powerpc/include/generated/asm/preempt.h:1, + from ./include/linux/preempt.h:78, + from ./include/linux/spinlock.h:51, + from fs/fs-writeback.c:19: +In function 'strncpy', + inlined from 'perf_trace_writeback_page_template' at +./include/trace/events/writeback.h:56:1: +./include/linux/string.h:260:9: warning: '__builtin_strncpy' specified +bound 32 equals destination size [-Wstringop-truncation] + return __builtin_strncpy(p, q, size); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Fix it by using the new strscpy_pad() which was introduced in "lib/string: +Add strscpy_pad() function" and will always be NUL-terminated instead of +strncpy(). Also, change strlcpy() to use strscpy_pad() in this file for +consistency. + +Link: http://lkml.kernel.org/r/1564075099-27750-1-git-send-email-cai@lca.pw +Fixes: 455b2864686d ("writeback: Initial tracing support") +Fixes: 028c2dd184c0 ("writeback: Add tracing to balance_dirty_pages") +Fixes: e84d0a4f8e39 ("writeback: trace event writeback_queue_io") +Fixes: b48c104d2211 ("writeback: trace event bdi_dirty_ratelimit") +Fixes: cc1676d917f3 ("writeback: Move requeueing when I_SYNC set to writeback_sb_inodes()") +Fixes: 9fb0a7da0c52 ("writeback: add more tracepoints") +Signed-off-by: Qian Cai +Reviewed-by: Jan Kara +Cc: Tobin C. Harding +Cc: Steven Rostedt (VMware) +Cc: Ingo Molnar +Cc: Tejun Heo +Cc: Dave Chinner +Cc: Fengguang Wu +Cc: Jens Axboe +Cc: Joe Perches +Cc: Kees Cook +Cc: Jann Horn +Cc: Jonathan Corbet +Cc: Nitin Gote +Cc: Rasmus Villemoes +Cc: Stephen Kitt +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + include/trace/events/writeback.h | 38 +++++++++++++++++--------------- + 1 file changed, 20 insertions(+), 18 deletions(-) + +diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h +index 146e7b3faa856..b463e2575117e 100644 +--- a/include/trace/events/writeback.h ++++ b/include/trace/events/writeback.h +@@ -65,8 +65,9 @@ TRACE_EVENT(writeback_dirty_page, + ), + + TP_fast_assign( +- strncpy(__entry->name, +- mapping ? dev_name(inode_to_bdi(mapping->host)->dev) : "(unknown)", 32); ++ strscpy_pad(__entry->name, ++ mapping ? dev_name(inode_to_bdi(mapping->host)->dev) : "(unknown)", ++ 32); + __entry->ino = mapping ? mapping->host->i_ino : 0; + __entry->index = page->index; + ), +@@ -95,8 +96,8 @@ DECLARE_EVENT_CLASS(writeback_dirty_inode_template, + struct backing_dev_info *bdi = inode_to_bdi(inode); + + /* may be called for files on pseudo FSes w/ unregistered bdi */ +- strncpy(__entry->name, +- bdi->dev ? dev_name(bdi->dev) : "(unknown)", 32); ++ strscpy_pad(__entry->name, ++ bdi->dev ? dev_name(bdi->dev) : "(unknown)", 32); + __entry->ino = inode->i_ino; + __entry->state = inode->i_state; + __entry->flags = flags; +@@ -175,8 +176,8 @@ DECLARE_EVENT_CLASS(writeback_write_inode_template, + ), + + TP_fast_assign( +- strncpy(__entry->name, +- dev_name(inode_to_bdi(inode)->dev), 32); ++ strscpy_pad(__entry->name, ++ dev_name(inode_to_bdi(inode)->dev), 32); + __entry->ino = inode->i_ino; + __entry->sync_mode = wbc->sync_mode; + __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc); +@@ -219,8 +220,9 @@ DECLARE_EVENT_CLASS(writeback_work_class, + __field(unsigned int, cgroup_ino) + ), + TP_fast_assign( +- strncpy(__entry->name, +- wb->bdi->dev ? dev_name(wb->bdi->dev) : "(unknown)", 32); ++ strscpy_pad(__entry->name, ++ wb->bdi->dev ? dev_name(wb->bdi->dev) : ++ "(unknown)", 32); + __entry->nr_pages = work->nr_pages; + __entry->sb_dev = work->sb ? work->sb->s_dev : 0; + __entry->sync_mode = work->sync_mode; +@@ -273,7 +275,7 @@ DECLARE_EVENT_CLASS(writeback_class, + __field(unsigned int, cgroup_ino) + ), + TP_fast_assign( +- strncpy(__entry->name, dev_name(wb->bdi->dev), 32); ++ strscpy_pad(__entry->name, dev_name(wb->bdi->dev), 32); + __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); + ), + TP_printk("bdi %s: cgroup_ino=%u", +@@ -295,7 +297,7 @@ TRACE_EVENT(writeback_bdi_register, + __array(char, name, 32) + ), + TP_fast_assign( +- strncpy(__entry->name, dev_name(bdi->dev), 32); ++ strscpy_pad(__entry->name, dev_name(bdi->dev), 32); + ), + TP_printk("bdi %s", + __entry->name +@@ -320,7 +322,7 @@ DECLARE_EVENT_CLASS(wbc_class, + ), + + TP_fast_assign( +- strncpy(__entry->name, dev_name(bdi->dev), 32); ++ strscpy_pad(__entry->name, dev_name(bdi->dev), 32); + __entry->nr_to_write = wbc->nr_to_write; + __entry->pages_skipped = wbc->pages_skipped; + __entry->sync_mode = wbc->sync_mode; +@@ -371,7 +373,7 @@ TRACE_EVENT(writeback_queue_io, + __field(unsigned int, cgroup_ino) + ), + TP_fast_assign( +- strncpy(__entry->name, dev_name(wb->bdi->dev), 32); ++ strncpy_pad(__entry->name, dev_name(wb->bdi->dev), 32); + __entry->older = dirtied_before; + __entry->age = (jiffies - dirtied_before) * 1000 / HZ; + __entry->moved = moved; +@@ -456,7 +458,7 @@ TRACE_EVENT(bdi_dirty_ratelimit, + ), + + TP_fast_assign( +- strlcpy(__entry->bdi, dev_name(wb->bdi->dev), 32); ++ strscpy_pad(__entry->bdi, dev_name(wb->bdi->dev), 32); + __entry->write_bw = KBps(wb->write_bandwidth); + __entry->avg_write_bw = KBps(wb->avg_write_bandwidth); + __entry->dirty_rate = KBps(dirty_rate); +@@ -521,7 +523,7 @@ TRACE_EVENT(balance_dirty_pages, + + TP_fast_assign( + unsigned long freerun = (thresh + bg_thresh) / 2; +- strlcpy(__entry->bdi, dev_name(wb->bdi->dev), 32); ++ strscpy_pad(__entry->bdi, dev_name(wb->bdi->dev), 32); + + __entry->limit = global_wb_domain.dirty_limit; + __entry->setpoint = (global_wb_domain.dirty_limit + +@@ -581,8 +583,8 @@ TRACE_EVENT(writeback_sb_inodes_requeue, + ), + + TP_fast_assign( +- strncpy(__entry->name, +- dev_name(inode_to_bdi(inode)->dev), 32); ++ strscpy_pad(__entry->name, ++ dev_name(inode_to_bdi(inode)->dev), 32); + __entry->ino = inode->i_ino; + __entry->state = inode->i_state; + __entry->dirtied_when = inode->dirtied_when; +@@ -655,8 +657,8 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, + ), + + TP_fast_assign( +- strncpy(__entry->name, +- dev_name(inode_to_bdi(inode)->dev), 32); ++ strscpy_pad(__entry->name, ++ dev_name(inode_to_bdi(inode)->dev), 32); + __entry->ino = inode->i_ino; + __entry->state = inode->i_state; + __entry->dirtied_when = inode->dirtied_when; +-- +2.27.0 + diff --git a/queue-4.19/lib-string-add-strscpy_pad-function.patch b/queue-4.19/lib-string-add-strscpy_pad-function.patch new file mode 100644 index 00000000000..8d03d3ae36c --- /dev/null +++ b/queue-4.19/lib-string-add-strscpy_pad-function.patch @@ -0,0 +1,118 @@ +From a6e0fbc1b4b613c76d40803edf360c6af3cc0b92 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 5 Apr 2019 12:58:58 +1100 +Subject: lib/string: Add strscpy_pad() function + +From: Tobin C. Harding + +[ Upstream commit 458a3bf82df4fe1f951d0f52b1e0c1e9d5a88a3b ] + +We have a function to copy strings safely and we have a function to copy +strings and zero the tail of the destination (if source string is +shorter than destination buffer) but we do not have a function to do +both at once. This means developers must write this themselves if they +desire this functionality. This is a chore, and also leaves us open to +off by one errors unnecessarily. + +Add a function that calls strscpy() then memset()s the tail to zero if +the source string is shorter than the destination buffer. + +Acked-by: Kees Cook +Signed-off-by: Tobin C. Harding +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + include/linux/string.h | 4 ++++ + lib/string.c | 47 +++++++++++++++++++++++++++++++++++------- + 2 files changed, 44 insertions(+), 7 deletions(-) + +diff --git a/include/linux/string.h b/include/linux/string.h +index 4db285b83f44e..1e0c442b941e2 100644 +--- a/include/linux/string.h ++++ b/include/linux/string.h +@@ -31,6 +31,10 @@ size_t strlcpy(char *, const char *, size_t); + #ifndef __HAVE_ARCH_STRSCPY + ssize_t strscpy(char *, const char *, size_t); + #endif ++ ++/* Wraps calls to strscpy()/memset(), no arch specific code required */ ++ssize_t strscpy_pad(char *dest, const char *src, size_t count); ++ + #ifndef __HAVE_ARCH_STRCAT + extern char * strcat(char *, const char *); + #endif +diff --git a/lib/string.c b/lib/string.c +index edf4907ec946f..f7f7770444bf5 100644 +--- a/lib/string.c ++++ b/lib/string.c +@@ -158,11 +158,9 @@ EXPORT_SYMBOL(strlcpy); + * @src: Where to copy the string from + * @count: Size of destination buffer + * +- * Copy the string, or as much of it as fits, into the dest buffer. +- * The routine returns the number of characters copied (not including +- * the trailing NUL) or -E2BIG if the destination buffer wasn't big enough. +- * The behavior is undefined if the string buffers overlap. +- * The destination buffer is always NUL terminated, unless it's zero-sized. ++ * Copy the string, or as much of it as fits, into the dest buffer. The ++ * behavior is undefined if the string buffers overlap. The destination ++ * buffer is always NUL terminated, unless it's zero-sized. + * + * Preferred to strlcpy() since the API doesn't require reading memory + * from the src string beyond the specified "count" bytes, and since +@@ -172,8 +170,10 @@ EXPORT_SYMBOL(strlcpy); + * + * Preferred to strncpy() since it always returns a valid string, and + * doesn't unnecessarily force the tail of the destination buffer to be +- * zeroed. If the zeroing is desired, it's likely cleaner to use strscpy() +- * with an overflow test, then just memset() the tail of the dest buffer. ++ * zeroed. If zeroing is desired please use strscpy_pad(). ++ * ++ * Return: The number of characters copied (not including the trailing ++ * %NUL) or -E2BIG if the destination buffer wasn't big enough. + */ + ssize_t strscpy(char *dest, const char *src, size_t count) + { +@@ -260,6 +260,39 @@ char *stpcpy(char *__restrict__ dest, const char *__restrict__ src) + } + EXPORT_SYMBOL(stpcpy); + ++/** ++ * strscpy_pad() - Copy a C-string into a sized buffer ++ * @dest: Where to copy the string to ++ * @src: Where to copy the string from ++ * @count: Size of destination buffer ++ * ++ * Copy the string, or as much of it as fits, into the dest buffer. The ++ * behavior is undefined if the string buffers overlap. The destination ++ * buffer is always %NUL terminated, unless it's zero-sized. ++ * ++ * If the source string is shorter than the destination buffer, zeros ++ * the tail of the destination buffer. ++ * ++ * For full explanation of why you may want to consider using the ++ * 'strscpy' functions please see the function docstring for strscpy(). ++ * ++ * Return: The number of characters copied (not including the trailing ++ * %NUL) or -E2BIG if the destination buffer wasn't big enough. ++ */ ++ssize_t strscpy_pad(char *dest, const char *src, size_t count) ++{ ++ ssize_t written; ++ ++ written = strscpy(dest, src, count); ++ if (written < 0 || written == count - 1) ++ return written; ++ ++ memset(dest + written + 1, 0, count - written - 1); ++ ++ return written; ++} ++EXPORT_SYMBOL(strscpy_pad); ++ + #ifndef __HAVE_ARCH_STRCAT + /** + * strcat - Append one %NUL-terminated string to another +-- +2.27.0 + diff --git a/queue-4.19/memcg-fix-a-crash-in-wb_workfn-when-a-device-disappe.patch b/queue-4.19/memcg-fix-a-crash-in-wb_workfn-when-a-device-disappe.patch new file mode 100644 index 00000000000..1c615469c79 --- /dev/null +++ b/queue-4.19/memcg-fix-a-crash-in-wb_workfn-when-a-device-disappe.patch @@ -0,0 +1,236 @@ +From c7ba337965208e179a866a1593f609278b566c42 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 30 Jan 2020 22:11:04 -0800 +Subject: memcg: fix a crash in wb_workfn when a device disappears + +From: Theodore Ts'o + +[ Upstream commit 68f23b89067fdf187763e75a56087550624fdbee ] + +Without memcg, there is a one-to-one mapping between the bdi and +bdi_writeback structures. In this world, things are fairly +straightforward; the first thing bdi_unregister() does is to shutdown +the bdi_writeback structure (or wb), and part of that writeback ensures +that no other work queued against the wb, and that the wb is fully +drained. + +With memcg, however, there is a one-to-many relationship between the bdi +and bdi_writeback structures; that is, there are multiple wb objects +which can all point to a single bdi. There is a refcount which prevents +the bdi object from being released (and hence, unregistered). So in +theory, the bdi_unregister() *should* only get called once its refcount +goes to zero (bdi_put will drop the refcount, and when it is zero, +release_bdi gets called, which calls bdi_unregister). + +Unfortunately, del_gendisk() in block/gen_hd.c never got the memo about +the Brave New memcg World, and calls bdi_unregister directly. It does +this without informing the file system, or the memcg code, or anything +else. This causes the root wb associated with the bdi to be +unregistered, but none of the memcg-specific wb's are shutdown. So when +one of these wb's are woken up to do delayed work, they try to +dereference their wb->bdi->dev to fetch the device name, but +unfortunately bdi->dev is now NULL, thanks to the bdi_unregister() +called by del_gendisk(). As a result, *boom*. + +Fortunately, it looks like the rest of the writeback path is perfectly +happy with bdi->dev and bdi->owner being NULL, so the simplest fix is to +create a bdi_dev_name() function which can handle bdi->dev being NULL. +This also allows us to bulletproof the writeback tracepoints to prevent +them from dereferencing a NULL pointer and crashing the kernel if one is +tracing with memcg's enabled, and an iSCSI device dies or a USB storage +stick is pulled. + +The most common way of triggering this will be hotremoval of a device +while writeback with memcg enabled is going on. It was triggering +several times a day in a heavily loaded production environment. + +Google Bug Id: 145475544 + +Link: https://lore.kernel.org/r/20191227194829.150110-1-tytso@mit.edu +Link: http://lkml.kernel.org/r/20191228005211.163952-1-tytso@mit.edu +Signed-off-by: Theodore Ts'o +Cc: Chris Mason +Cc: Tejun Heo +Cc: Jens Axboe +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + fs/fs-writeback.c | 2 +- + include/linux/backing-dev.h | 10 ++++++++++ + include/trace/events/writeback.h | 29 +++++++++++++---------------- + mm/backing-dev.c | 1 + + 4 files changed, 25 insertions(+), 17 deletions(-) + +diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c +index f2d0c4acb3cbb..a247cb4b00e2d 100644 +--- a/fs/fs-writeback.c ++++ b/fs/fs-writeback.c +@@ -1986,7 +1986,7 @@ void wb_workfn(struct work_struct *work) + struct bdi_writeback, dwork); + long pages_written; + +- set_worker_desc("flush-%s", dev_name(wb->bdi->dev)); ++ set_worker_desc("flush-%s", bdi_dev_name(wb->bdi)); + current->flags |= PF_SWAPWRITE; + + if (likely(!current_is_workqueue_rescuer() || +diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h +index c28a47cbe355e..1ef4aca7b953f 100644 +--- a/include/linux/backing-dev.h ++++ b/include/linux/backing-dev.h +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -498,4 +499,13 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) + (1 << WB_async_congested)); + } + ++extern const char *bdi_unknown_name; ++ ++static inline const char *bdi_dev_name(struct backing_dev_info *bdi) ++{ ++ if (!bdi || !bdi->dev) ++ return bdi_unknown_name; ++ return dev_name(bdi->dev); ++} ++ + #endif /* _LINUX_BACKING_DEV_H */ +diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h +index b463e2575117e..300afa559f467 100644 +--- a/include/trace/events/writeback.h ++++ b/include/trace/events/writeback.h +@@ -66,8 +66,8 @@ TRACE_EVENT(writeback_dirty_page, + + TP_fast_assign( + strscpy_pad(__entry->name, +- mapping ? dev_name(inode_to_bdi(mapping->host)->dev) : "(unknown)", +- 32); ++ bdi_dev_name(mapping ? inode_to_bdi(mapping->host) : ++ NULL), 32); + __entry->ino = mapping ? mapping->host->i_ino : 0; + __entry->index = page->index; + ), +@@ -96,8 +96,7 @@ DECLARE_EVENT_CLASS(writeback_dirty_inode_template, + struct backing_dev_info *bdi = inode_to_bdi(inode); + + /* may be called for files on pseudo FSes w/ unregistered bdi */ +- strscpy_pad(__entry->name, +- bdi->dev ? dev_name(bdi->dev) : "(unknown)", 32); ++ strscpy_pad(__entry->name, bdi_dev_name(bdi), 32); + __entry->ino = inode->i_ino; + __entry->state = inode->i_state; + __entry->flags = flags; +@@ -177,7 +176,7 @@ DECLARE_EVENT_CLASS(writeback_write_inode_template, + + TP_fast_assign( + strscpy_pad(__entry->name, +- dev_name(inode_to_bdi(inode)->dev), 32); ++ bdi_dev_name(inode_to_bdi(inode)), 32); + __entry->ino = inode->i_ino; + __entry->sync_mode = wbc->sync_mode; + __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc); +@@ -220,9 +219,7 @@ DECLARE_EVENT_CLASS(writeback_work_class, + __field(unsigned int, cgroup_ino) + ), + TP_fast_assign( +- strscpy_pad(__entry->name, +- wb->bdi->dev ? dev_name(wb->bdi->dev) : +- "(unknown)", 32); ++ strscpy_pad(__entry->name, bdi_dev_name(wb->bdi), 32); + __entry->nr_pages = work->nr_pages; + __entry->sb_dev = work->sb ? work->sb->s_dev : 0; + __entry->sync_mode = work->sync_mode; +@@ -275,7 +272,7 @@ DECLARE_EVENT_CLASS(writeback_class, + __field(unsigned int, cgroup_ino) + ), + TP_fast_assign( +- strscpy_pad(__entry->name, dev_name(wb->bdi->dev), 32); ++ strscpy_pad(__entry->name, bdi_dev_name(wb->bdi), 32); + __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); + ), + TP_printk("bdi %s: cgroup_ino=%u", +@@ -297,7 +294,7 @@ TRACE_EVENT(writeback_bdi_register, + __array(char, name, 32) + ), + TP_fast_assign( +- strscpy_pad(__entry->name, dev_name(bdi->dev), 32); ++ strscpy_pad(__entry->name, bdi_dev_name(bdi), 32); + ), + TP_printk("bdi %s", + __entry->name +@@ -322,7 +319,7 @@ DECLARE_EVENT_CLASS(wbc_class, + ), + + TP_fast_assign( +- strscpy_pad(__entry->name, dev_name(bdi->dev), 32); ++ strscpy_pad(__entry->name, bdi_dev_name(bdi), 32); + __entry->nr_to_write = wbc->nr_to_write; + __entry->pages_skipped = wbc->pages_skipped; + __entry->sync_mode = wbc->sync_mode; +@@ -373,7 +370,7 @@ TRACE_EVENT(writeback_queue_io, + __field(unsigned int, cgroup_ino) + ), + TP_fast_assign( +- strncpy_pad(__entry->name, dev_name(wb->bdi->dev), 32); ++ strscpy_pad(__entry->name, bdi_dev_name(wb->bdi), 32); + __entry->older = dirtied_before; + __entry->age = (jiffies - dirtied_before) * 1000 / HZ; + __entry->moved = moved; +@@ -458,7 +455,7 @@ TRACE_EVENT(bdi_dirty_ratelimit, + ), + + TP_fast_assign( +- strscpy_pad(__entry->bdi, dev_name(wb->bdi->dev), 32); ++ strscpy_pad(__entry->bdi, bdi_dev_name(wb->bdi), 32); + __entry->write_bw = KBps(wb->write_bandwidth); + __entry->avg_write_bw = KBps(wb->avg_write_bandwidth); + __entry->dirty_rate = KBps(dirty_rate); +@@ -523,7 +520,7 @@ TRACE_EVENT(balance_dirty_pages, + + TP_fast_assign( + unsigned long freerun = (thresh + bg_thresh) / 2; +- strscpy_pad(__entry->bdi, dev_name(wb->bdi->dev), 32); ++ strscpy_pad(__entry->bdi, bdi_dev_name(wb->bdi), 32); + + __entry->limit = global_wb_domain.dirty_limit; + __entry->setpoint = (global_wb_domain.dirty_limit + +@@ -584,7 +581,7 @@ TRACE_EVENT(writeback_sb_inodes_requeue, + + TP_fast_assign( + strscpy_pad(__entry->name, +- dev_name(inode_to_bdi(inode)->dev), 32); ++ bdi_dev_name(inode_to_bdi(inode)), 32); + __entry->ino = inode->i_ino; + __entry->state = inode->i_state; + __entry->dirtied_when = inode->dirtied_when; +@@ -658,7 +655,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, + + TP_fast_assign( + strscpy_pad(__entry->name, +- dev_name(inode_to_bdi(inode)->dev), 32); ++ bdi_dev_name(inode_to_bdi(inode)), 32); + __entry->ino = inode->i_ino; + __entry->state = inode->i_state; + __entry->dirtied_when = inode->dirtied_when; +diff --git a/mm/backing-dev.c b/mm/backing-dev.c +index 72e6d0c55cfad..0a970be24a28d 100644 +--- a/mm/backing-dev.c ++++ b/mm/backing-dev.c +@@ -19,6 +19,7 @@ struct backing_dev_info noop_backing_dev_info = { + EXPORT_SYMBOL_GPL(noop_backing_dev_info); + + static struct class *bdi_class; ++const char *bdi_unknown_name = "(unknown)"; + + /* + * bdi_lock protects updates to bdi_list. bdi_list has RCU reader side +-- +2.27.0 + diff --git a/queue-4.19/series b/queue-4.19/series index 0c15744d9e1..e6c19d000ea 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -13,3 +13,6 @@ iwlwifi-pcie-fix-context-info-memory-leak.patch iwlwifi-mvm-guard-against-device-removal-in-reprobe.patch sunrpc-move-simple_get_bytes-and-simple_get_netobj-i.patch sunrpc-handle-0-length-opaque-xdr-object-data-proper.patch +lib-string-add-strscpy_pad-function.patch +include-trace-events-writeback.h-fix-wstringop-trunc.patch +memcg-fix-a-crash-in-wb_workfn-when-a-device-disappe.patch