--- zzzz-none-000/linux-4.9.231/include/trace/events/writeback.h 2020-07-22 07:10:54.000000000 +0000 +++ falcon-5530-730/linux-4.9.231/include/trace/events/writeback.h 2022-08-31 08:19:49.000000000 +0000 @@ -65,8 +65,10 @@ ), TP_fast_assign( - strncpy(__entry->name, - mapping ? dev_name(inode_to_bdi(mapping->host)->dev) : "(unknown)", 32); + strlcpy(__entry->name, + mapping ? dev_name(inode_to_bdi(mapping->host)->dev) + : "(unknown)", + sizeof(__entry->name)); __entry->ino = mapping ? mapping->host->i_ino : 0; __entry->index = page->index; ), @@ -95,8 +97,10 @@ 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); + strlcpy(__entry->name, + bdi->dev ? dev_name(bdi->dev) + : "(unknown)", + sizeof(__entry->name)); __entry->ino = inode->i_ino; __entry->state = inode->i_state; __entry->flags = flags; @@ -175,8 +179,8 @@ ), TP_fast_assign( - strncpy(__entry->name, - dev_name(inode_to_bdi(inode)->dev), 32); + strlcpy(__entry->name, dev_name(inode_to_bdi(inode)->dev), + sizeof(__entry->name)); __entry->ino = inode->i_ino; __entry->sync_mode = wbc->sync_mode; __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc); @@ -219,8 +223,9 @@ __field(unsigned int, cgroup_ino) ), TP_fast_assign( - strncpy(__entry->name, - wb->bdi->dev ? dev_name(wb->bdi->dev) : "(unknown)", 32); + strlcpy(__entry->name, + wb->bdi->dev ? dev_name(wb->bdi->dev) : "(unknown)", + sizeof(__entry->name)); __entry->nr_pages = work->nr_pages; __entry->sb_dev = work->sb ? work->sb->s_dev : 0; __entry->sync_mode = work->sync_mode; @@ -273,7 +278,8 @@ __field(unsigned int, cgroup_ino) ), TP_fast_assign( - strncpy(__entry->name, dev_name(wb->bdi->dev), 32); + strlcpy(__entry->name, dev_name(wb->bdi->dev), + sizeof(__entry->name)); __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); ), TP_printk("bdi %s: cgroup_ino=%u", @@ -296,7 +302,8 @@ __array(char, name, 32) ), TP_fast_assign( - strncpy(__entry->name, dev_name(bdi->dev), 32); + strlcpy(__entry->name, dev_name(bdi->dev), + sizeof(__entry->name)); ), TP_printk("bdi %s", __entry->name @@ -321,7 +328,8 @@ ), TP_fast_assign( - strncpy(__entry->name, dev_name(bdi->dev), 32); + strlcpy(__entry->name, dev_name(bdi->dev), + sizeof(__entry->name)); __entry->nr_to_write = wbc->nr_to_write; __entry->pages_skipped = wbc->pages_skipped; __entry->sync_mode = wbc->sync_mode; @@ -372,7 +380,8 @@ ), TP_fast_assign( unsigned long *older_than_this = work->older_than_this; - strncpy(__entry->name, dev_name(wb->bdi->dev), 32); + strlcpy(__entry->name, dev_name(wb->bdi->dev), + sizeof(__entry->name)); __entry->older = older_than_this ? *older_than_this : 0; __entry->age = older_than_this ? (jiffies - *older_than_this) * 1000 / HZ : -1; @@ -583,8 +592,9 @@ ), TP_fast_assign( - strncpy(__entry->name, - dev_name(inode_to_bdi(inode)->dev), 32); + strlcpy(__entry->name, + dev_name(inode_to_bdi(inode)->dev), + sizeof(__entry->name)); __entry->ino = inode->i_ino; __entry->state = inode->i_state; __entry->dirtied_when = inode->dirtied_when; @@ -657,8 +667,9 @@ ), TP_fast_assign( - strncpy(__entry->name, - dev_name(inode_to_bdi(inode)->dev), 32); + strlcpy(__entry->name, + dev_name(inode_to_bdi(inode)->dev), + sizeof(__entry->name)); __entry->ino = inode->i_ino; __entry->state = inode->i_state; __entry->dirtied_when = inode->dirtied_when;