mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge tag 'mm-nonmm-stable-2024-05-19-11-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull non-mm updates from Andrew Morton:
"Mainly singleton patches, documented in their respective changelogs.
Notable series include:
- Some maintenance and performance work for ocfs2 in Heming Zhao's
series "improve write IO performance when fragmentation is high".
- Some ocfs2 bugfixes from Su Yue in the series "ocfs2 bugs fixes
exposed by fstests".
- kfifo header rework from Andy Shevchenko in the series "kfifo:
Clean up kfifo.h".
- GDB script fixes from Florian Rommel in the series "scripts/gdb:
Fixes for $lx_current and $lx_per_cpu".
- After much discussion, a coding-style update from Barry Song
explaining one reason why inline functions are preferred over
macros. The series is "codingstyle: avoid unused parameters for a
function-like macro""
* tag 'mm-nonmm-stable-2024-05-19-11-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (62 commits)
fs/proc: fix softlockup in __read_vmcore
nilfs2: convert BUG_ON() in nilfs_finish_roll_forward() to WARN_ON()
scripts: checkpatch: check unused parameters for function-like macro
Documentation: coding-style: ask function-like macros to evaluate parameters
nilfs2: use __field_struct() for a bitwise field
selftests/kcmp: remove unused open mode
nilfs2: remove calls to folio_set_error() and folio_clear_error()
kernel/watchdog_perf.c: tidy up kerneldoc
watchdog: allow nmi watchdog to use raw perf event
watchdog: handle comma separated nmi_watchdog command line
nilfs2: make superblock data array index computation sparse friendly
squashfs: remove calls to set the folio error flag
squashfs: convert squashfs_symlink_read_folio to use folio APIs
scripts/gdb: fix detection of current CPU in KGDB
scripts/gdb: make get_thread_info accept pointers
scripts/gdb: fix parameter handling in $lx_per_cpu
scripts/gdb: fix failing KGDB detection during probe
kfifo: don't use "proxy" headers
media: stih-cec: add missing io.h
media: rc: add missing io.h
...
This commit is contained in:
@@ -136,10 +136,6 @@ System kernel config options
|
||||
|
||||
CONFIG_KEXEC_CORE=y
|
||||
|
||||
Subsequently, CRASH_CORE is selected by KEXEC_CORE::
|
||||
|
||||
CONFIG_CRASH_CORE=y
|
||||
|
||||
2) Enable "sysfs file system support" in "Filesystem" -> "Pseudo
|
||||
filesystems." This is usually enabled by default::
|
||||
|
||||
@@ -168,6 +164,10 @@ Dump-capture kernel config options (Arch Independent)
|
||||
|
||||
CONFIG_CRASH_DUMP=y
|
||||
|
||||
And this will select VMCORE_INFO and CRASH_RESERVE::
|
||||
CONFIG_VMCORE_INFO=y
|
||||
CONFIG_CRASH_RESERVE=y
|
||||
|
||||
2) Enable "/proc/vmcore support" under "Filesystems" -> "Pseudo filesystems"::
|
||||
|
||||
CONFIG_PROC_VMCORE=y
|
||||
|
||||
@@ -3787,10 +3787,12 @@
|
||||
Format: [state][,regs][,debounce][,die]
|
||||
|
||||
nmi_watchdog= [KNL,BUGS=X86] Debugging features for SMP kernels
|
||||
Format: [panic,][nopanic,][num]
|
||||
Format: [panic,][nopanic,][rNNN,][num]
|
||||
Valid num: 0 or 1
|
||||
0 - turn hardlockup detector in nmi_watchdog off
|
||||
1 - turn hardlockup detector in nmi_watchdog on
|
||||
rNNN - configure the watchdog with raw perf event 0xNNN
|
||||
|
||||
When panic is specified, panic when an NMI watchdog
|
||||
timeout occurs (or 'nopanic' to not panic on an NMI
|
||||
watchdog, if CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is set)
|
||||
@@ -7507,4 +7509,3 @@
|
||||
memory, and other data can't be written using
|
||||
xmon commands.
|
||||
off xmon is disabled.
|
||||
|
||||
|
||||
@@ -906,6 +906,20 @@ Macros, Attributes and Symbols
|
||||
|
||||
See: https://lore.kernel.org/lkml/1399671106.2912.21.camel@joe-AO725/
|
||||
|
||||
**MACRO_ARG_UNUSED**
|
||||
If function-like macros do not utilize a parameter, it might result
|
||||
in a build warning. We advocate for utilizing static inline functions
|
||||
to replace such macros.
|
||||
For example, for a macro such as the one below::
|
||||
|
||||
#define test(a) do { } while (0)
|
||||
|
||||
there would be a warning like below::
|
||||
|
||||
WARNING: Argument 'a' is not used in function-like macro.
|
||||
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl
|
||||
|
||||
**SINGLE_STATEMENT_DO_WHILE_MACRO**
|
||||
For the multi-statement macros, it is necessary to use the do-while
|
||||
loop to avoid unpredictable code paths. The do-while loop helps to
|
||||
|
||||
@@ -827,6 +827,29 @@ Macros with multiple statements should be enclosed in a do - while block:
|
||||
do_this(b, c); \
|
||||
} while (0)
|
||||
|
||||
Function-like macros with unused parameters should be replaced by static
|
||||
inline functions to avoid the issue of unused variables:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
static inline void fun(struct foo *foo)
|
||||
{
|
||||
}
|
||||
|
||||
Due to historical practices, many files still employ the "cast to (void)"
|
||||
approach to evaluate parameters. However, this method is not advisable.
|
||||
Inline functions address the issue of "expression with side effects
|
||||
evaluated more than once", circumvent unused-variable problems, and
|
||||
are generally better documented than macros for some reason.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
/*
|
||||
* Avoid doing this whenever possible and instead opt for static
|
||||
* inline functions
|
||||
*/
|
||||
#define macrofun(foo) do { (void) (foo); } while (0)
|
||||
|
||||
Things to avoid when using macros:
|
||||
|
||||
1) macros that affect control flow:
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <linux/jump_label.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/instrumented.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
@@ -61,10 +62,20 @@ unsigned long copy_mc_enhanced_fast_string(void *dst, const void *src, unsigned
|
||||
*/
|
||||
unsigned long __must_check copy_mc_to_kernel(void *dst, const void *src, unsigned len)
|
||||
{
|
||||
if (copy_mc_fragile_enabled)
|
||||
return copy_mc_fragile(dst, src, len);
|
||||
if (static_cpu_has(X86_FEATURE_ERMS))
|
||||
return copy_mc_enhanced_fast_string(dst, src, len);
|
||||
unsigned long ret;
|
||||
|
||||
if (copy_mc_fragile_enabled) {
|
||||
instrument_memcpy_before(dst, src, len);
|
||||
ret = copy_mc_fragile(dst, src, len);
|
||||
instrument_memcpy_after(dst, src, len, ret);
|
||||
return ret;
|
||||
}
|
||||
if (static_cpu_has(X86_FEATURE_ERMS)) {
|
||||
instrument_memcpy_before(dst, src, len);
|
||||
ret = copy_mc_enhanced_fast_string(dst, src, len);
|
||||
instrument_memcpy_after(dst, src, len, ret);
|
||||
return ret;
|
||||
}
|
||||
memcpy(dst, src, len);
|
||||
return 0;
|
||||
}
|
||||
@@ -75,6 +86,7 @@ unsigned long __must_check copy_mc_to_user(void __user *dst, const void *src, un
|
||||
unsigned long ret;
|
||||
|
||||
if (copy_mc_fragile_enabled) {
|
||||
instrument_copy_to_user(dst, src, len);
|
||||
__uaccess_begin();
|
||||
ret = copy_mc_fragile((__force void *)dst, src, len);
|
||||
__uaccess_end();
|
||||
@@ -82,6 +94,7 @@ unsigned long __must_check copy_mc_to_user(void __user *dst, const void *src, un
|
||||
}
|
||||
|
||||
if (static_cpu_has(X86_FEATURE_ERMS)) {
|
||||
instrument_copy_to_user(dst, src, len);
|
||||
__uaccess_begin();
|
||||
ret = copy_mc_enhanced_fast_string((__force void *)dst, src, len);
|
||||
__uaccess_end();
|
||||
|
||||
@@ -131,8 +131,7 @@ static bool ldm_parse_tocblock (const u8 *data, struct tocblock *toc)
|
||||
ldm_crit ("Cannot find TOCBLOCK, database may be corrupt.");
|
||||
return false;
|
||||
}
|
||||
strncpy (toc->bitmap1_name, data + 0x24, sizeof (toc->bitmap1_name));
|
||||
toc->bitmap1_name[sizeof (toc->bitmap1_name) - 1] = 0;
|
||||
strscpy_pad(toc->bitmap1_name, data + 0x24, sizeof(toc->bitmap1_name));
|
||||
toc->bitmap1_start = get_unaligned_be64(data + 0x2E);
|
||||
toc->bitmap1_size = get_unaligned_be64(data + 0x36);
|
||||
|
||||
@@ -142,8 +141,7 @@ static bool ldm_parse_tocblock (const u8 *data, struct tocblock *toc)
|
||||
TOC_BITMAP1, toc->bitmap1_name);
|
||||
return false;
|
||||
}
|
||||
strncpy (toc->bitmap2_name, data + 0x46, sizeof (toc->bitmap2_name));
|
||||
toc->bitmap2_name[sizeof (toc->bitmap2_name) - 1] = 0;
|
||||
strscpy_pad(toc->bitmap2_name, data + 0x46, sizeof(toc->bitmap2_name));
|
||||
toc->bitmap2_start = get_unaligned_be64(data + 0x50);
|
||||
toc->bitmap2_size = get_unaligned_be64(data + 0x58);
|
||||
if (strncmp (toc->bitmap2_name, TOC_BITMAP2,
|
||||
|
||||
@@ -871,7 +871,7 @@ intel_th_alloc(struct device *dev, const struct intel_th_drvdata *drvdata,
|
||||
if (!th)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
th->id = ida_simple_get(&intel_th_ida, 0, 0, GFP_KERNEL);
|
||||
th->id = ida_alloc(&intel_th_ida, GFP_KERNEL);
|
||||
if (th->id < 0) {
|
||||
err = th->id;
|
||||
goto err_alloc;
|
||||
@@ -931,7 +931,7 @@ err_chrdev:
|
||||
"intel_th/output");
|
||||
|
||||
err_ida:
|
||||
ida_simple_remove(&intel_th_ida, th->id);
|
||||
ida_free(&intel_th_ida, th->id);
|
||||
|
||||
err_alloc:
|
||||
kfree(th);
|
||||
@@ -964,7 +964,7 @@ void intel_th_free(struct intel_th *th)
|
||||
__unregister_chrdev(th->major, 0, TH_POSSIBLE_OUTPUTS,
|
||||
"intel_th/output");
|
||||
|
||||
ida_simple_remove(&intel_th_ida, th->id);
|
||||
ida_free(&intel_th_ida, th->id);
|
||||
|
||||
kfree(th);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
#include <linux/clk.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <linux/clk.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/reset.h>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/serial_reg.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
@@ -64,7 +64,7 @@ static void mux_chip_release(struct device *dev)
|
||||
{
|
||||
struct mux_chip *mux_chip = to_mux_chip(dev);
|
||||
|
||||
ida_simple_remove(&mux_ida, mux_chip->id);
|
||||
ida_free(&mux_ida, mux_chip->id);
|
||||
kfree(mux_chip);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ struct mux_chip *mux_chip_alloc(struct device *dev,
|
||||
mux_chip->dev.of_node = dev->of_node;
|
||||
dev_set_drvdata(&mux_chip->dev, mux_chip);
|
||||
|
||||
mux_chip->id = ida_simple_get(&mux_ida, 0, 0, GFP_KERNEL);
|
||||
mux_chip->id = ida_alloc(&mux_ida, GFP_KERNEL);
|
||||
if (mux_chip->id < 0) {
|
||||
int err = mux_chip->id;
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ static void parport_attach(struct parport *port)
|
||||
return;
|
||||
}
|
||||
|
||||
index = ida_simple_get(&pps_client_index, 0, 0, GFP_KERNEL);
|
||||
index = ida_alloc(&pps_client_index, GFP_KERNEL);
|
||||
memset(&pps_client_cb, 0, sizeof(pps_client_cb));
|
||||
pps_client_cb.private = device;
|
||||
pps_client_cb.irq_func = parport_irq;
|
||||
@@ -188,7 +188,7 @@ err_release_dev:
|
||||
err_unregister_dev:
|
||||
parport_unregister_device(device->pardev);
|
||||
err_free:
|
||||
ida_simple_remove(&pps_client_index, index);
|
||||
ida_free(&pps_client_index, index);
|
||||
kfree(device);
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ static void parport_detach(struct parport *port)
|
||||
pps_unregister_source(device->pps);
|
||||
parport_release(pardev);
|
||||
parport_unregister_device(pardev);
|
||||
ida_simple_remove(&pps_client_index, device->index);
|
||||
ida_free(&pps_client_index, device->index);
|
||||
kfree(device);
|
||||
}
|
||||
|
||||
|
||||
@@ -1934,7 +1934,7 @@ static void free_note_info(struct elf_note_info *info)
|
||||
threads = t->next;
|
||||
WARN_ON(t->notes[0].data && t->notes[0].data != &t->prstatus);
|
||||
for (i = 1; i < info->thread_notes; ++i)
|
||||
kfree(t->notes[i].data);
|
||||
kvfree(t->notes[i].data);
|
||||
kfree(t);
|
||||
}
|
||||
kfree(info->psinfo.data);
|
||||
|
||||
12
fs/fat/dir.c
12
fs/fat/dir.c
@@ -269,6 +269,18 @@ enum { PARSE_INVALID = 1, PARSE_NOT_LONGNAME, PARSE_EOF, };
|
||||
/**
|
||||
* fat_parse_long - Parse extended directory entry.
|
||||
*
|
||||
* @dir: Pointer to the inode that represents the directory.
|
||||
* @pos: On input, contains the starting position to read from.
|
||||
* On output, updated with the new position.
|
||||
* @bh: Pointer to the buffer head that may be used for reading directory
|
||||
* entries. May be updated.
|
||||
* @de: On input, points to the current directory entry.
|
||||
* On output, points to the next directory entry.
|
||||
* @unicode: Pointer to a buffer where the parsed Unicode long filename will be
|
||||
* stored.
|
||||
* @nr_slots: Pointer to a variable that will store the number of longname
|
||||
* slots found.
|
||||
*
|
||||
* This function returns zero on success, negative value on error, or one of
|
||||
* the following:
|
||||
*
|
||||
|
||||
@@ -1857,13 +1857,22 @@ nilfs_btree_commit_convert_and_insert(struct nilfs_bmap *btree,
|
||||
}
|
||||
|
||||
/**
|
||||
* nilfs_btree_convert_and_insert -
|
||||
* @bmap:
|
||||
* @key:
|
||||
* @ptr:
|
||||
* @keys:
|
||||
* @ptrs:
|
||||
* @n:
|
||||
* nilfs_btree_convert_and_insert - Convert and insert entries into a B-tree
|
||||
* @btree: NILFS B-tree structure
|
||||
* @key: Key of the new entry to be inserted
|
||||
* @ptr: Pointer (block number) associated with the key to be inserted
|
||||
* @keys: Array of keys to be inserted in addition to @key
|
||||
* @ptrs: Array of pointers associated with @keys
|
||||
* @n: Number of keys and pointers in @keys and @ptrs
|
||||
*
|
||||
* This function is used to insert a new entry specified by @key and @ptr,
|
||||
* along with additional entries specified by @keys and @ptrs arrays, into a
|
||||
* NILFS B-tree.
|
||||
* It prepares the necessary changes by allocating the required blocks and any
|
||||
* necessary intermediate nodes. It converts configurations from other forms of
|
||||
* block mapping (the one that currently exists is direct mapping) to a B-tree.
|
||||
*
|
||||
* Return: 0 on success or a negative error code on failure.
|
||||
*/
|
||||
int nilfs_btree_convert_and_insert(struct nilfs_bmap *btree,
|
||||
__u64 key, __u64 ptr,
|
||||
|
||||
@@ -174,7 +174,6 @@ Eend:
|
||||
dir->i_ino, (folio->index << PAGE_SHIFT) + offs,
|
||||
(unsigned long)le64_to_cpu(p->inode));
|
||||
fail:
|
||||
folio_set_error(folio);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -175,6 +175,7 @@ int nilfs_init_gcinode(struct inode *inode)
|
||||
|
||||
/**
|
||||
* nilfs_remove_all_gcinodes() - remove all unprocessed gc inodes
|
||||
* @nilfs: NILFS filesystem instance
|
||||
*/
|
||||
void nilfs_remove_all_gcinodes(struct the_nilfs *nilfs)
|
||||
{
|
||||
|
||||
@@ -335,8 +335,8 @@ void __nilfs_error(struct super_block *sb, const char *function,
|
||||
|
||||
extern struct nilfs_super_block *
|
||||
nilfs_read_super_block(struct super_block *, u64, int, struct buffer_head **);
|
||||
extern int nilfs_store_magic_and_option(struct super_block *,
|
||||
struct nilfs_super_block *, char *);
|
||||
extern int nilfs_store_magic(struct super_block *sb,
|
||||
struct nilfs_super_block *sbp);
|
||||
extern int nilfs_check_feature_compatibility(struct super_block *,
|
||||
struct nilfs_super_block *);
|
||||
extern void nilfs_set_log_cursor(struct nilfs_super_block *,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user