projects/linux·commit eb6a9339

Merge tag 'mm-nonmm-stable-2024-05-19-11-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

eb6a9339 · Linus Torvalds <[email protected]> · 2024-05-19 14:02:03 -07:00

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
  ...
Commit
eb6a9339efeb6f3d2b5c86fdf2382cdc293eca2c
Parents
16dbfae8 · 5cbcb62d

Merge commit. Changes below are compared with the first parent: 16dbfae8.

Changes

77 files changed · +679 −427

FileStatusAddDelContent
Documentation/admin-guide/kdump/kdump.rstmodified+4−4View file
Documentation/admin-guide/kernel-parameters.txtmodified+3−2View file
Documentation/dev-tools/checkpatch.rstmodified+14−0View file
Documentation/process/coding-style.rstmodified+23−0View file
arch/x86/lib/copy_mc.cmodified+17−4View file
block/partitions/ldm.cmodified+2−4View file
drivers/hwtracing/intel_th/core.cmodified+3−3View file
drivers/media/cec/platform/sti/stih-cec.cmodified+1−0View file
drivers/media/rc/mtk-cir.cmodified+1−0View file
drivers/media/rc/serial_ir.cmodified+1−0View file
drivers/media/rc/st_rc.cmodified+1−0View file
drivers/media/rc/sunxi-cir.cmodified+1−0View file
drivers/mux/core.cmodified+2−2View file
drivers/pps/clients/pps_parport.cmodified+3−3View file
fs/binfmt_elf.cmodified+1−1View file
fs/fat/dir.cmodified+12−0View file
fs/nilfs2/btree.cmodified+16−7View file
fs/nilfs2/dir.cmodified+0−1View file
fs/nilfs2/gcinode.cmodified+1−0View file
fs/nilfs2/nilfs.hmodified+2−2View file
fs/nilfs2/recovery.cmodified+4−1View file
fs/nilfs2/segment.cmodified+1−7View file
fs/nilfs2/super.cmodified+169−219View file
fs/nilfs2/the_nilfs.cmodified+20−5View file
fs/nilfs2/the_nilfs.hmodified+1−5View file
fs/ocfs2/aops.cmodified+0−2View file
fs/ocfs2/dlm/dlmdomain.cmodified+5−7View file
fs/ocfs2/export.cmodified+6−6View file
fs/ocfs2/file.cmodified+2−0View file
fs/ocfs2/inode.cmodified+2−0View file
fs/ocfs2/ioctl.cmodified+1−0View file
fs/ocfs2/localalloc.cmodified+14−20View file
fs/ocfs2/move_extents.cmodified+1−1View file
fs/ocfs2/namei.cmodified+3−1View file
fs/ocfs2/ocfs2_fs.hmodified+2−1View file
fs/ocfs2/refcounttree.cmodified+1−1View file
fs/ocfs2/reservations.cmodified+1−1View file
fs/ocfs2/resize.cmodified+8−0View file
fs/ocfs2/suballoc.cmodified+97−20View file
fs/ocfs2/suballoc.hmodified+5−1View file
fs/proc/vmcore.cmodified+4−3View file
fs/squashfs/file.cmodified+1−5View file
fs/squashfs/file_direct.cmodified+1−2View file
fs/squashfs/namei.cmodified+4−10View file
fs/squashfs/symlink.cmodified+16−19View file
include/linux/cpumask.hmodified+0−5View file
include/linux/instrumented.hmodified+35−0View file
include/linux/kexec.hmodified+2−4View file
include/linux/kfifo.hmodified+7−2View file
include/linux/kmsan-checks.hmodified+15−0View file
include/linux/nmi.hmodified+2−0View file
include/trace/events/nilfs2.hmodified+5−1View file
init/do_mounts_initrd.cmodified+0−1View file
init/main.cmodified+19−0View file
ipc/ipc_sysctl.cmodified+0−1View file
ipc/mq_sysctl.cmodified+0−1View file
kernel/crash_core.cmodified+2−0View file
kernel/crash_reserve.cmodified+2−2View file
kernel/kcov.cmodified+2−1View file
kernel/regset.cmodified+3−3View file
kernel/trace/blktrace.cmodified+1−2View file
kernel/watchdog.cmodified+9−0View file
kernel/watchdog_perf.cmodified+45−2View file
lib/Kconfig.kgdbmodified+1−0View file
lib/build_OID_registrymodified+4−1View file
lib/devres.cmodified+15−11View file
lib/kfifo.cmodified+4−4View file
lib/test_hexdump.cmodified+1−1View file
mm/kmsan/hooks.cmodified+11−0View file
samples/kfifo/dma-example.cmodified+2−1View file
scripts/checkpatch.plmodified+6−0View file
scripts/gdb/linux/cpus.pymodified+3−8View file
scripts/gdb/linux/tasks.pymodified+1−1View file
scripts/gdb/linux/utils.pymodified+1−1View file
tools/include/linux/rbtree_augmented.hmodified+2−2View file
tools/lib/rbtree.cmodified+1−1View file
tools/testing/selftests/kcmp/kcmp_test.cmodified+1−1View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/admin-guide/kdump/kdump.rst

View file
diff --git a/Documentation/admin-guide/kdump/kdump.rst b/Documentation/admin-guide/kdump/kdump.rst
index 0302a93..5376890 100644
--- a/Documentation/admin-guide/kdump/kdump.rst
+++ b/Documentation/admin-guide/kdump/kdump.rst
@@ -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

Documentation/admin-guide/kernel-parameters.txt

View file
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 90f79a2..ef25e06 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -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.
-

Documentation/dev-tools/checkpatch.rst

View file
diff --git a/Documentation/dev-tools/checkpatch.rst b/Documentation/dev-tools/checkpatch.rst
index 1279689..a9fac97 100644
--- a/Documentation/dev-tools/checkpatch.rst
+++ b/Documentation/dev-tools/checkpatch.rst
@@ -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

Documentation/process/coding-style.rst

View file
diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
index 9c7cf73..7e768c6 100644
--- a/Documentation/process/coding-style.rst
+++ b/Documentation/process/coding-style.rst
@@ -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:

arch/x86/lib/copy_mc.c

View file
diff --git a/arch/x86/lib/copy_mc.c b/arch/x86/lib/copy_mc.c
index 6e8b7e6..97e88e5 100644
--- a/arch/x86/lib/copy_mc.c
+++ b/arch/x86/lib/copy_mc.c
@@ -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();

block/partitions/ldm.c

View file
diff --git a/block/partitions/ldm.c b/block/partitions/ldm.c
index 38e5896..2bd42fe 100644
--- a/block/partitions/ldm.c
+++ b/block/partitions/ldm.c
@@ -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,

drivers/hwtracing/intel_th/core.c

View file
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index cc7f879..86c8efe 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -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);
}

drivers/media/cec/platform/sti/stih-cec.c

View file
diff --git a/drivers/media/cec/platform/sti/stih-cec.c b/drivers/media/cec/platform/sti/stih-cec.c
index a20fc5c..99978a7 100644
--- a/drivers/media/cec/platform/sti/stih-cec.c
+++ b/drivers/media/cec/platform/sti/stih-cec.c
@@ -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>

drivers/media/rc/mtk-cir.c

View file
diff --git a/drivers/media/rc/mtk-cir.c b/drivers/media/rc/mtk-cir.c
index 4e294e5..b2f82b2 100644
--- a/drivers/media/rc/mtk-cir.c
+++ b/drivers/media/rc/mtk-cir.c
@@ -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>

drivers/media/rc/serial_ir.c

View file
diff --git a/drivers/media/rc/serial_ir.c b/drivers/media/rc/serial_ir.c
index 96ae029..fc5fd39 100644
--- a/drivers/media/rc/serial_ir.c
+++ b/drivers/media/rc/serial_ir.c
@@ -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>

drivers/media/rc/st_rc.c

View file
diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
index 28477aa..988b091 100644
--- a/drivers/media/rc/st_rc.c
+++ b/drivers/media/rc/st_rc.c
@@ -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>

drivers/media/rc/sunxi-cir.c

View file
diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c
index bf58c96..b49df83 100644
--- a/drivers/media/rc/sunxi-cir.c
+++ b/drivers/media/rc/sunxi-cir.c
@@ -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>

drivers/mux/core.c

View file
diff --git a/drivers/mux/core.c b/drivers/mux/core.c
index 7758161..78c0022 100644
--- a/drivers/mux/core.c
+++ b/drivers/mux/core.c
@@ -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;

drivers/pps/clients/pps_parport.c

View file
diff --git a/drivers/pps/clients/pps_parport.c b/drivers/pps/clients/pps_parport.c
index 42f93d4..af972cd 100644
--- a/drivers/pps/clients/pps_parport.c
+++ b/drivers/pps/clients/pps_parport.c
@@ -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);
}

fs/binfmt_elf.c

View file
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index b5a25ee..a43897b 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -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);

fs/fat/dir.c

View file
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index 00235b8..acbec5b 100644
--- a/fs/fat/dir.c
+++ b/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:
*

fs/nilfs2/btree.c

View file
diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c
index 65659fa..a139970 100644
--- a/fs/nilfs2/btree.c
+++ b/fs/nilfs2/btree.c
@@ -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,

fs/nilfs2/dir.c

View file
diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c
index aee40db..a002a44 100644
--- a/fs/nilfs2/dir.c
+++ b/fs/nilfs2/dir.c
@@ -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;
}

fs/nilfs2/gcinode.c

View file
diff --git a/fs/nilfs2/gcinode.c b/fs/nilfs2/gcinode.c
index bf9a11d..1c9ae36 100644
--- a/fs/nilfs2/gcinode.c
+++ b/fs/nilfs2/gcinode.c
@@ -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)
{

fs/nilfs2/nilfs.h

View file
diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h
index 2e29b98..728e90b 100644
--- a/fs/nilfs2/nilfs.h
+++ b/fs/nilfs2/nilfs.h
@@ -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 *,

fs/nilfs2/recovery.c

View file
diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c
index 49a70c6..020f304 100644
--- a/fs/nilfs2/recovery.c
+++ b/fs/nilfs2/recovery.c
@@ -563,6 +563,7 @@ static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
* checkpoint
* @nilfs: nilfs object
* @sb: super block instance
+ * @root: NILFS root instance
* @ri: pointer to a nilfs_recovery_info
*/
static int nilfs_do_roll_forward(struct the_nilfs *nilfs,
@@ -698,7 +699,9 @@ static void nilfs_finish_roll_forward(struct the_nilfs *nilfs,
return;
bh = __getblk(nilfs->ns_bdev, ri->ri_lsegs_start, nilfs->ns_blocksize);
- BUG_ON(!bh);
+ if (WARN_ON(!bh))
+ return; /* should never happen */
+
memset(bh->b_data, 0, bh->b_size);
set_buffer_dirty(bh);
err = sync_dirty_buffer(bh);

fs/nilfs2/segment.c

View file
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index aa5290c..8654ab8 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -1725,14 +1725,8 @@ static void nilfs_end_folio_io(struct folio *folio, int err)
return;
}
- if (!err) {
- if (!nilfs_folio_buffers_clean(folio))
- filemap_dirty_folio(folio->mapping, folio);
- folio_clear_error(folio);
- } else {
+ if (err || !nilfs_folio_buffers_clean(folio))
filemap_dirty_folio(folio->mapping, folio);
- folio_set_error(folio);
- }
folio_end_writeback(folio);
}

fs/nilfs2/super.c

View file
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index ac24ed1..e835e1f 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -29,13 +29,13 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/blkdev.h>
-#include <linux/parser.h>
#include <linux/crc32.h>
#include <linux/vfs.h>
#include <linux/writeback.h>
#include <linux/seq_file.h>
#include <linux/mount.h>
#include <linux/fs_context.h>
+#include <linux/fs_parser.h>
#include "nilfs.h"
#include "export.h"
#include "mdt.h"
@@ -61,7 +61,6 @@ struct kmem_cache *nilfs_segbuf_cachep;
struct kmem_cache *nilfs_btree_path_cache;
static int nilfs_setup_super(struct super_block *sb, int is_mount);
-static int nilfs_remount(struct super_block *sb, int *flags, char *data);
void __nilfs_msg(struct super_block *sb, const char *fmt, ...)
{
@@ -702,105 +701,98 @@ static const struct super_operations nilfs_sops = {
.freeze_fs = nilfs_freeze,
.unfreeze_fs = nilfs_unfreeze,
.statfs = nilfs_statfs,
- .remount_fs = nilfs_remount,
.show_options = nilfs_show_options
};
enum {
- Opt_err_cont, Opt_err_panic, Opt_err_ro,
- Opt_barrier, Opt_nobarrier, Opt_snapshot, Opt_order, Opt_norecovery,
- Opt_discard, Opt_nodiscard, Opt_err,
+ Opt_err, Opt_barrier, Opt_snapshot, Opt_order, Opt_norecovery,
+ Opt_discard,
};
-static match_table_t tokens = {
- {Opt_err_cont, "errors=continue"},
- {Opt_err_panic, "errors=panic"},
- {Opt_err_ro, "errors=remount-ro"},
- {Opt_barrier, "barrier"},
- {Opt_nobarrier, "nobarrier"},
- {Opt_snapshot, "cp=%u"},
- {Opt_order, "order=%s"},
- {Opt_norecovery, "norecovery"},
- {Opt_discard, "discard"},
- {Opt_nodiscard, "nodiscard"},
- {Opt_err, NULL}
+static const struct constant_table nilfs_param_err[] = {
+ {"continue", NILFS_MOUNT_ERRORS_CONT},
+ {"panic", NILFS_MOUNT_ERRORS_PANIC},
+ {"remount-ro", NILFS_MOUNT_ERRORS_RO},
+ {}
};
-static int parse_options(char *options, struct super_block *sb, int is_remount)
-{
- struct the_nilfs *nilfs = sb->s_fs_info;
- char *p;
- substring_t args[MAX_OPT_ARGS];
-
- if (!options)
- return 1;
-
- while ((p = strsep(&options, ",")) != NULL) {
- int token;
+static const struct fs_parameter_spec nilfs_param_spec[] = {
+ fsparam_enum ("errors", Opt_err, nilfs_param_err),
+ fsparam_flag_no ("barrier", Opt_barrier),
+ fsparam_u64 ("cp", Opt_snapshot),
+ fsparam_string ("order", Opt_order),
+ fsparam_flag ("norecovery", Opt_norecovery),
+ fsparam_flag_no ("discard", Opt_discard),
+ {}
+};
- if (!*p)
- continue;
+struct nilfs_fs_context {
+ unsigned long ns_mount_opt;
+ __u64 cno;
+};
- token = match_token(p, tokens, args);
- switch (token) {
- case Opt_barrier:
- nilfs_set_opt(nilfs, BARRIER);
- break;
- case Opt_nobarrier:
+static int nilfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
+{
+ struct nilfs_fs_context *nilfs = fc->fs_private;
+ int is_remount = fc->purpose == FS_CONTEXT_FOR_RECONFIGURE;
+ struct fs_parse_result result;
+ int opt;
+
+ opt = fs_parse(fc, nilfs_param_spec, param, &result);
+ if (opt < 0)
+ return opt;
+
+ switch (opt) {
+ case Opt_barrier:
+ if (result.negated)
nilfs_clear_opt(nilfs, BARRIER);
- break;
- case Opt_order:
- if (strcmp(args[0].from, "relaxed") == 0)
- /* Ordered data semantics */
- nilfs_clear_opt(nilfs, STRICT_ORDER);
- else if (strcmp(args[0].from, "strict") == 0)
- /* Strict in-order semantics */
- nilfs_set_opt(nilfs, STRICT_ORDER);

This diff is incomplete. Download the complete patch.

fs/nilfs2/the_nilfs.c

View file

This diff is incomplete. Download the complete patch.

fs/nilfs2/the_nilfs.h

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/aops.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmdomain.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/export.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/ioctl.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/localalloc.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/move_extents.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/namei.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/ocfs2_fs.h

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/refcounttree.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/reservations.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/resize.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/suballoc.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/suballoc.h

View file

This diff is incomplete. Download the complete patch.

fs/proc/vmcore.c

View file

This diff is incomplete. Download the complete patch.

fs/squashfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/squashfs/file_direct.c

View file

This diff is incomplete. Download the complete patch.

fs/squashfs/namei.c

View file

This diff is incomplete. Download the complete patch.

fs/squashfs/symlink.c

View file

This diff is incomplete. Download the complete patch.

include/linux/cpumask.h

View file

This diff is incomplete. Download the complete patch.

include/linux/instrumented.h

View file

This diff is incomplete. Download the complete patch.

include/linux/kexec.h

View file

This diff is incomplete. Download the complete patch.

include/linux/kfifo.h

View file

This diff is incomplete. Download the complete patch.

include/linux/kmsan-checks.h

View file

This diff is incomplete. Download the complete patch.

include/linux/nmi.h

View file

This diff is incomplete. Download the complete patch.

include/trace/events/nilfs2.h

View file

This diff is incomplete. Download the complete patch.

init/do_mounts_initrd.c

View file

This diff is incomplete. Download the complete patch.

init/main.c

View file

This diff is incomplete. Download the complete patch.

ipc/ipc_sysctl.c

View file

This diff is incomplete. Download the complete patch.

ipc/mq_sysctl.c

View file

This diff is incomplete. Download the complete patch.

kernel/crash_core.c

View file

This diff is incomplete. Download the complete patch.

kernel/crash_reserve.c

View file

This diff is incomplete. Download the complete patch.

kernel/kcov.c

View file

This diff is incomplete. Download the complete patch.

kernel/regset.c

View file

This diff is incomplete. Download the complete patch.

kernel/trace/blktrace.c

View file

This diff is incomplete. Download the complete patch.

kernel/watchdog.c

View file

This diff is incomplete. Download the complete patch.

kernel/watchdog_perf.c

View file

This diff is incomplete. Download the complete patch.

lib/Kconfig.kgdb

View file

This diff is incomplete. Download the complete patch.

lib/build_OID_registry

View file

This diff is incomplete. Download the complete patch.

lib/devres.c

View file

This diff is incomplete. Download the complete patch.

lib/kfifo.c

View file

This diff is incomplete. Download the complete patch.

lib/test_hexdump.c

View file

This diff is incomplete. Download the complete patch.

mm/kmsan/hooks.c

View file

This diff is incomplete. Download the complete patch.

samples/kfifo/dma-example.c

View file

This diff is incomplete. Download the complete patch.

scripts/checkpatch.pl

View file

This diff is incomplete. Download the complete patch.

scripts/gdb/linux/cpus.py

View file

This diff is incomplete. Download the complete patch.

scripts/gdb/linux/tasks.py

View file

This diff is incomplete. Download the complete patch.

scripts/gdb/linux/utils.py

View file

This diff is incomplete. Download the complete patch.

tools/include/linux/rbtree_augmented.h

View file

This diff is incomplete. Download the complete patch.

tools/lib/rbtree.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/kcmp/kcmp_test.c

View file

This diff is incomplete. Download the complete patch.