id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
7df54188a897ff656e237239f2b02a8f70183333
Analyze and fix the following issue in the Linux kernel code: Documentation: add pyyaml to requirements.txt
Problem Details: Commit f061c9f7d058 ("Documentation: Document each netlink family") added a new Python script that is invoked during 'make htmldocs' and which reads the netlink YAML spec files. Using the virtualenv from scripts/sphinx-pre-install, we get this new error wen running 'make htmldocs': Traceback (most ...
```diff diff --git a/Documentation/sphinx/requirements.txt b/Documentation/sphinx/requirements.txt index 335b53df35e2..a8a1aff6445e 100644 --- a/Documentation/sphinx/requirements.txt +++ b/Documentation/sphinx/requirements.txt @@ -1,3 +1,4 @@ # jinja2>=3.1 is not compatible with Sphinx<4.0 jinja2<3.1 Sphinx==2.4.4 +...
961410c9e8534d3c6f347c04cacf50bc5c002a3f
Analyze and fix the following issue in the Linux kernel code: drivers/usb/gadget/udc: Fix spelling typo in comments(reqest->request)
Problem Details: Fix spelling typo in comments. Reported-by: k2ci <kernel-bot@kylinos.cn> Signed-off-by: liyouhong <liyouhong@kylinos.cn> Link: https://lore.kernel.org/r/20231221023425.1316397-1-liyouhong@kylinos.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index 535b6e79a198..e8042c158f6d 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -1360,7 +1360,7 @@ static void ch9getstatus(struct fsl_udc *udc, u8 request_type, u16 valu...
afe28cd686aeb77e8d9140d50fb1cf06a7ecb731
Analyze and fix the following issue in the Linux kernel code: Revert "usb: dwc3: don't reset device side if dwc3 was configured as host-only"
Problem Details: This reverts commit e835c0a4e23c38531dcee5ef77e8d1cf462658c7. Don't omit soft-reset. During initialization, the driver may need to perform a soft reset to ensure the phy is ready when the controller updates the GCTL.PRTCAPDIR or other settings by issuing phy soft-reset. Many platforms often have acces...
```diff diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 832c41fec4f7..f50b5575d588 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -277,9 +277,9 @@ int dwc3_core_soft_reset(struct dwc3 *dwc) /* * We're resetting only the device side because, if we're in host mode, * XH...
7059fbebcb00554c3f31e5b5d93ef6d2d96dc7b4
Analyze and fix the following issue in the Linux kernel code: Revert "usb: dwc3: Soft reset phy on probe for host"
Problem Details: This reverts commit 8bea147dfdf823eaa8d3baeccc7aeb041b41944b. The phy soft reset GUSB2PHYCFG.PHYSOFTRST only applies to UTMI phy, not ULPI. This fix is incomplete. Cc: <stable@vger.kernel.org> Fixes: 8bea147dfdf8 ("usb: dwc3: Soft reset phy on probe for host") Reported-by: Köry Maincent <kory.maince...
```diff diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index b101dbf8c5dc..832c41fec4f7 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -279,46 +279,9 @@ int dwc3_core_soft_reset(struct dwc3 *dwc) * XHCI driver will reset the host block. If dwc3 was configured for * host-only...
9c6b789e954fae73c548f39332bcc56bdf0d4373
Analyze and fix the following issue in the Linux kernel code: Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs"
Problem Details: This reverts commit b17b7fe6dd5c6ff74b38b0758ca799cdbb79e26e. That commit messed up the reference counting, so it needs to be rethought. Fixes: b17b7fe6dd5c ("usb: typec: class: fix typec_altmode_put_partner to put plugs") Cc: <stable@vger.kernel.org> Cc: RD Babiera <rdbabiera@google.com> Reported-b...
```diff diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index aeae8009b9e3..4d11f2b536fa 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -267,7 +267,7 @@ static void typec_altmode_put_partner(struct altmode *altmode) if (!partner) return; - adev = &altmode->adev; + ad...
7f6ca95d16b96567ce4cf458a2790ff17fa620c3
Analyze and fix the following issue in the Linux kernel code: net: Implement missing getsockopt(SO_TIMESTAMPING_NEW)
Problem Details: Commit 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") added the new socket option SO_TIMESTAMPING_NEW. Setting the option is handled in sk_setsockopt(), querying it was not handled in sk_getsockopt(), though. Following remarks on an earlier submission of this patch, keep the old behavior of getsocko...
```diff diff --git a/net/core/sock.c b/net/core/sock.c index fef349dd72fa..51d52859e942 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1711,9 +1711,16 @@ int sk_getsockopt(struct sock *sk, int level, int optname, break; case SO_TIMESTAMPING_OLD: + case SO_TIMESTAMPING_NEW: lv = sizeof(v.timestamping);...
2fee84030d12d9fddfa874e4562d71761a129277
Analyze and fix the following issue in the Linux kernel code: drm/vkms: Avoid reading beyond LUT array
Problem Details: When the floor LUT index (drm_fixp2int(lut_index) is the last index of the array the ceil LUT index will point to an entry beyond the array. Make sure we guard against it and use the value of the floor LUT index. v3: - Drop bits from commit description that didn't contribute anything of value Fix...
```diff diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c index 3c99fb8b54e2..e7441b227b3c 100644 --- a/drivers/gpu/drm/vkms/vkms_composer.c +++ b/drivers/gpu/drm/vkms/vkms_composer.c @@ -123,6 +123,8 @@ static u16 apply_lut_to_channel_value(const struct vkms_color_lut *lut, u16 c...
cf8837d7204481026335461629b84ac7f4538fa5
Analyze and fix the following issue in the Linux kernel code: drm: Don't treat 0 as -1 in drm_fixp2int_ceil
Problem Details: Unit testing this in VKMS shows that passing 0 into this function returns -1, which is highly counter- intuitive. Fix it by checking whether the input is >= 0 instead of > 0. Fixes: 64566b5e767f ("drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil") Signed-off-by: Harry Wentland <harry.wentland@amd...
```diff diff --git a/include/drm/drm_fixed.h b/include/drm/drm_fixed.h index 6ea339d5de08..0c9f917a4d4b 100644 --- a/include/drm/drm_fixed.h +++ b/include/drm/drm_fixed.h @@ -95,7 +95,7 @@ static inline int drm_fixp2int_round(s64 a) static inline int drm_fixp2int_ceil(s64 a) { - if (a > 0) + if (a >= 0) return d...
993498e537af9260e697219ce41b41b22b6199cc
Analyze and fix the following issue in the Linux kernel code: net-device: move gso_partial_features to net_device_read_tx
Problem Details: dev->gso_partial_features is read from tx fast path for GSO packets. Move it to appropriate section to avoid a cache line miss. Fixes: 43a71cd66b9c ("net-device: reorganize net_device fast path variables") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Coco Li <lixiaoyan@google.com> Cc: David ...
```diff diff --git a/Documentation/networking/net_cachelines/net_device.rst b/Documentation/networking/net_cachelines/net_device.rst index 6cab1b797739..2dd8d8f20da2 100644 --- a/Documentation/networking/net_cachelines/net_device.rst +++ b/Documentation/networking/net_cachelines/net_device.rst @@ -38,7 +38,7 @@ netdev_...
9dd3f1ef40d01fdfe69c3ada28b1f201a7207f6e
Analyze and fix the following issue in the Linux kernel code: platform/x86/amd/pmf: Return directly after a failed apmf_if_call() in apmf_sbios_heartbeat_notify()
Problem Details: The kfree() function was called in one case by the apmf_sbios_heartbeat_notify() function during error handling even if the passed variable contained a null pointer. This issue was detected by using the Coccinelle software. * Thus return directly after a call of the function “apmf_if_call” failed at...
```diff diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/amd/pmf/acpi.c index 4ec7957eb707..eb367e38c5ab 100644 --- a/drivers/platform/x86/amd/pmf/acpi.c +++ b/drivers/platform/x86/amd/pmf/acpi.c @@ -135,11 +135,9 @@ static void apmf_sbios_heartbeat_notify(struct work_struct *work) dev_dbg(dev-...
87d8f1ee1d4070571095859d310f6951440f288c
Analyze and fix the following issue in the Linux kernel code: platform/x86: wmi: linux/wmi.h: fix Excess kernel-doc description warning
Problem Details: Remove the "private:" comment to prevent the kernel-doc warning: include/linux/wmi.h:27: warning: Excess struct member 'setable' description in 'wmi_device' Either a struct member is documented (via kernel-doc) or it's private, but not both. Fixes: b4cc979588ee ("platform/x86: wmi: Add kernel doc co...
```diff diff --git a/include/linux/wmi.h b/include/linux/wmi.h index 50f7f1e4fd4f..686291b87852 100644 --- a/include/linux/wmi.h +++ b/include/linux/wmi.h @@ -21,8 +21,6 @@ */ struct wmi_device { struct device dev; - - /* private: used by the WMI driver core */ bool setable; }; ```
669f157fd7ad987dd5beba46576ec357f4d6c686
Analyze and fix the following issue in the Linux kernel code: platform/x86/intel/pmc: Add missing extern
Problem Details: Add missing extern for tgl_h_reg_map. Fixes sparse warning: drivers/platform/x86/intel/pmc/tgl.c:213:26: warning: symbol 'tgl_h_reg_map' was not declared. Should it be static? Fixes: 544f7b7f651c ("platform/x86/intel/pmc: Add regmap for Tiger Lake H PCH") Signed-off-by: David E. Box <david.e.box@li...
```diff diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h index e2826e1ef90f..54137faaae2b 100644 --- a/drivers/platform/x86/intel/pmc/core.h +++ b/drivers/platform/x86/intel/pmc/core.h @@ -452,6 +452,7 @@ extern const struct pmc_bit_map tgl_vnn_misc_status_map[]; extern const ...
6f9fac5535ba2038063c656f0afb496d7f87bcc1
Analyze and fix the following issue in the Linux kernel code: platform/x86/intel/pmc/lnl: Add GBE LTR ignore during suspend
Problem Details: Add the GBE LTR ignore suspend time fix for Lunar Lake. Fixes: 119652b855e6 ("platform/x86/intel/pmc: Add Lunar Lake M support to intel_pmc_core driver") Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20231223032548.1680738-8-david.e.box@linux.intel.com Revie...
```diff diff --git a/drivers/platform/x86/intel/pmc/lnl.c b/drivers/platform/x86/intel/pmc/lnl.c index 842f9cca0392..abad17cdd3d7 100644 --- a/drivers/platform/x86/intel/pmc/lnl.c +++ b/drivers/platform/x86/intel/pmc/lnl.c @@ -509,6 +509,8 @@ static void lnl_d3_fixup(void) static int lnl_resume(struct pmc_dev *pmcdev)...
10ed9ee0af5a6cab8b36b301865417a288179b06
Analyze and fix the following issue in the Linux kernel code: platform/x86/intel/pmc/arl: Add GBE LTR ignore during suspend
Problem Details: Add the GBE LTR ignore suspend time fix for Arrow Lake. Fixes: f34dcf397286 ("platform/x86/intel/pmc: Add Arrow Lake S support to intel_pmc_core driver") Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20231223032548.1680738-7-david.e.box@linux.intel.com Revie...
```diff diff --git a/drivers/platform/x86/intel/pmc/arl.c b/drivers/platform/x86/intel/pmc/arl.c index e6190247f5df..683ae828276b 100644 --- a/drivers/platform/x86/intel/pmc/arl.c +++ b/drivers/platform/x86/intel/pmc/arl.c @@ -685,6 +685,8 @@ static void arl_d3_fixup(void) static int arl_resume(struct pmc_dev *pmcdev)...
eee706839333ec0643f1b4898a37588025bf4cb5
Analyze and fix the following issue in the Linux kernel code: drm/imagination: pvr_device.h: fix all kernel-doc warnings
Problem Details: Correct all kernel-doc notation on pvr_device.h so that there are no kernel-doc warnings remaining. pvr_device.h:292: warning: Excess struct member 'active' description in 'pvr_device' pvr_device.h:292: warning: Excess struct member 'idle' description in 'pvr_device' pvr_device.h:292: warning: Excess ...
```diff diff --git a/drivers/gpu/drm/imagination/pvr_device.h b/drivers/gpu/drm/imagination/pvr_device.h index 2ca7e535799f..ecdd5767d8ef 100644 --- a/drivers/gpu/drm/imagination/pvr_device.h +++ b/drivers/gpu/drm/imagination/pvr_device.h @@ -193,13 +193,14 @@ struct pvr_device { * @queues: Queue-related fields. ...
200a6b3af05918ddb18832fa4d5a8f15c9dd99e0
Analyze and fix the following issue in the Linux kernel code: drm/gpuvm: fix all kernel-doc warnings in include/drm/drm_gpuvm.h
Problem Details: Update kernel-doc comments in <drm/drm_gpuvm.h> to correct all kernel-doc warnings: drm_gpuvm.h:148: warning: Excess struct member 'addr' description in 'drm_gpuva' drm_gpuvm.h:148: warning: Excess struct member 'offset' description in 'drm_gpuva' drm_gpuvm.h:148: warning: Excess struct member 'obj' d...
```diff diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h index 6258849382e1..f3fdb810989a 100644 --- a/include/drm/drm_gpuvm.h +++ b/include/drm/drm_gpuvm.h @@ -92,7 +92,7 @@ struct drm_gpuva { */ struct { /** - * @addr: the start address + * @va.addr: the start address */ u64 addr; @...
c810729fe6471aa18e2b05bde4b7fb9d872b4ca0
Analyze and fix the following issue in the Linux kernel code: kernfs: fix reference to renamed function
Problem Details: commit c637b8acbe079edb477d887041755b489036f146 ("kernfs: s/sysfs/kernfs/ in internal functions and whatever is left") renamed kernfs_file_open to kernfs_fop_open, but didn't update the comment referencing it. Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Acked-by: Tejun Heo ...
```diff diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c index f0cb729e9a97..ffa4565c275a 100644 --- a/fs/kernfs/file.c +++ b/fs/kernfs/file.c @@ -447,7 +447,7 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma) * warnings and we don't want to add spurious locking dependency * between the...
fcf410e050a9c046b2907e3ab9145eb974044e0e
Analyze and fix the following issue in the Linux kernel code: ARM: MAINTAINERS: drop empty entries for removed boards
Problem Details: Drop empty and redundant maintainer entries for boards which were removed to fix `scripts/get_maintainer.pl --self-test=sections` errors like: ./MAINTAINERS:2021: warning: section without file pattern ARM/CIRRUS LOGIC EDB9315A MACHINE SUPPORT [arnd: only remove the obviously stale ones for now] Cc...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index a3ad4f9bd2ec..d1793fa3ae0e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2029,11 +2029,6 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Odd Fixes N: clps711x -ARM/CIRRUS LOGIC EDB9315A MACHINE SUPPORT -M: Lennert Buytenhek <kernel@...
ced296f636358c1593df0ef15523fa9aa93468ac
Analyze and fix the following issue in the Linux kernel code: ARM: Delete ARM11MPCore perf leftovers
Problem Details: My commit deleting the PB11MPCore apparently left a few dangling structs in the perf event code. Fix it up. Fixes: 2560cffd2134 ("ARM: Delete ARM11MPCore (ARM11 ARMv6K SMP) support") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://lo...
```diff diff --git a/arch/arm/kernel/perf_event_v6.c b/arch/arm/kernel/perf_event_v6.c index 3115077f6abc..0cbf46233d6b 100644 --- a/arch/arm/kernel/perf_event_v6.c +++ b/arch/arm/kernel/perf_event_v6.c @@ -113,69 +113,6 @@ static const unsigned armv6_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] [C(ITLB)][C(OP_WRITE)][C(R...
5314b1543787e6cd5d248186fcfd5c5fc4ca2146
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/exynos: Use set_trips ops
Problem Details: Currently, each trip point defined in the device tree corresponds to a single hardware interrupt. This commit instead switches to using two hardware interrupts, whose values are set dynamically using the set_trips callback. Additionally, the critical temperature threshold is handled specifically. Sett...
```diff diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index ca1b1cec0300..6482513bfe66 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -158,10 +158,12 @@ enum soc_type { * in the positive-TC generator block * 0 < reference_vo...
9da39ef332c417ce52732564c1c682a6e1209302
Analyze and fix the following issue in the Linux kernel code: tools/thermal/tmon: Fix compilation warning for wrong format
Problem Details: The following warnings are shown during compilation: tui.c: In function 'show_cooling_device': tui.c:216:40: warning: format '%d' expects argument of type 'int', but argument 7 has type 'long unsigned int' [-Wformat=] 216 | "%02d %12.12s%6d %6d", | ...
```diff diff --git a/tools/thermal/tmon/tui.c b/tools/thermal/tmon/tui.c index 031b258667d8..7f5dd2b87f15 100644 --- a/tools/thermal/tmon/tui.c +++ b/tools/thermal/tmon/tui.c @@ -213,7 +213,7 @@ void show_cooling_device(void) * cooling device instances. skip unused idr. */ mvwprintw(cooling_device_window, j ...
7ec597ba25a3d942e13870cc27848e301c26c561
Analyze and fix the following issue in the Linux kernel code: dt-bindings: thermal: qcom-spmi-adc-tm5/hc: Fix example node names
Problem Details: The ADC Thermal Monitor is part of an SPMI PMIC, which in turn sits on an SPMI bus. Fixes: db03874b8543 ("dt-bindings: thermal: qcom: add HC variant of adc-thermal monitor bindings") Fixes: e8ffd6c0756b ("dt-bindings: thermal: qcom: add adc-thermal monitor bindings") Signed-off-by: Johan Hovold <johan...
```diff diff --git a/Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm-hc.yaml b/Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm-hc.yaml index 01253d58bf9f..82f8f25885c0 100644 --- a/Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm-hc.yaml +++ b/Documentation/devicetree/bindings/thermal/qc...
15ef92e9c41124ee9d88b01208364f3fe1f45f84
Analyze and fix the following issue in the Linux kernel code: drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment
Problem Details: PTR_ERR() returns -ENODEV when thermal-zones are undefined, and we need -ENODEV as the right value for comparison. Otherwise, tz->type is NULL when thermal-zones is undefined, resulting in the following error: [ 12.290030] CPU 1 Unable to handle kernel paging request at virtual address ffffffffffff...
```diff diff --git a/drivers/thermal/loongson2_thermal.c b/drivers/thermal/loongson2_thermal.c index 133098dc0854..99ca0c7bc41c 100644 --- a/drivers/thermal/loongson2_thermal.c +++ b/drivers/thermal/loongson2_thermal.c @@ -127,7 +127,7 @@ static int loongson2_thermal_probe(struct platform_device *pdev) if (!IS_ERR(t...
88071e31e994ee23356674e0c5461b25e2a95cdc
Analyze and fix the following issue in the Linux kernel code: dt-bindings: thermal: loongson,ls2k-thermal: Fix binding check issues
Problem Details: Add the missing 'thermal-sensor-cells' property which is required for every thermal sensor as it's used when using phandles. And add the thermal-sensor.yaml reference. In fact, it was a careless mistake when submitting the driver that caused it to not work properly. So the fix is necessary, although i...
```diff diff --git a/Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml b/Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml index 7538469997f9..b634f57cd011 100644 --- a/Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml +++ b/Documentation/devicetree/bindings/ther...
d296e7b18521d60e3c428945c19a66ecf012c002
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix reattach_inode() for snapshots
Problem Details: reattach_inode() was broken w.r.t. snapshots - we'd lookup the subvolume to look up lost+found, but if we're in an interior node snapshot that didn't make any sense. Instead, this adds a dirent path for creating in a specific snapshot, skipping the subvolume; and we also make sure to create lost+found...
```diff diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c index 51fe04f45690..4ae1e9f002a0 100644 --- a/fs/bcachefs/dirent.c +++ b/fs/bcachefs/dirent.c @@ -198,6 +198,34 @@ static struct bkey_i_dirent *dirent_create_key(struct btree_trans *trans, return dirent; } +int bch2_dirent_create_snapshot(struct btre...
0c99e17d3bd3b60ee7461cb8e87ff6badf228422
Analyze and fix the following issue in the Linux kernel code: bcachefs: growable btree_paths
Problem Details: XXX: we're allocating memory with btree locks held - bad We need to plumb through an error path so we can do allocate_dropping_locks() - but we're merging this now because it fixes a transaction path overflow caused by indirect extent fragmentation, and the resize path is rare. Signed-off-by: Kent Ov...
```diff diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index 12a357f357cd..596fbb9a611f 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -1209,7 +1209,6 @@ static btree_path_idx_t btree_path_clone(struct btree_trans *trans, btree_path_i bool intent) { btree_path_idx_t ...
ff70ad2c8dfdcc24f98b645481116d4c2ea20e37
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix interior update path btree_path uses
Problem Details: Since the btree_paths array is now about to become growable, we have to be careful not to refer to paths by pointer across contexts where they may be reallocated. This fixes the remaining btree_interior_update() paths - split and merge. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c index 7e6ba3061e7c..2ec9ff06f1a6 100644 --- a/fs/bcachefs/btree_trans_commit.c +++ b/fs/bcachefs/btree_trans_commit.c @@ -823,7 +823,7 @@ static inline int do_bch2_trans_commit(struct btree_trans *trans, unsigned flags if (!sa...
31403dca5bb1e55ea0ea6ad1264b81fa8c9a3768
Analyze and fix the following issue in the Linux kernel code: bcachefs: optimize __bch2_trans_get(), kill DEBUG_TRANSACTIONS
Problem Details: - Some tweaks to greatly reduce locking overhead for the list of btree transactions, so that it can always be enabled: leave btree_trans objects on the list when they're on the percpu single item freelist, and only check for duplicates in the same process when CONFIG_BCACHEFS_DEBUG is enabl...
```diff diff --git a/fs/bcachefs/Kconfig b/fs/bcachefs/Kconfig index 7d3ac9556c98..5cdfef3b551a 100644 --- a/fs/bcachefs/Kconfig +++ b/fs/bcachefs/Kconfig @@ -50,14 +50,6 @@ config BCACHEFS_POSIX_ACL depends on BCACHEFS_FS select FS_POSIX_ACL -config BCACHEFS_DEBUG_TRANSACTIONS - bool "bcachefs runtime info" - de...
ef23397c301900e9e7050f8245e2a25b5eea1589
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix warning about uninitialized time_stats
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 00ddd91ddfcc..d530277f9017 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -447,9 +447,9 @@ void __bch2_time_stats_update(struct bch2_time_stats *stats, u64 start, u64 end) { unsigned long flags; - WARN_RATELIMIT(!stats->min_duration ||...
920388254f613410324a10695b43485a8d9f838a
Analyze and fix the following issue in the Linux kernel code: bcachefs: mean and variance: fix kernel-doc for function params
Problem Details: Add missing function parameter descriptions in mean_and_variance.c. The also eliminates the "Excess function parameter" warnings. Prevents these kernel-doc warnings: mean_and_variance.c:67: warning: Function parameter or member 's' not described in 'mean_and_variance_get_mean' mean_and_variance.c:78:...
```diff diff --git a/fs/bcachefs/mean_and_variance.c b/fs/bcachefs/mean_and_variance.c index 1f0801e2e565..bf0ef668fd38 100644 --- a/fs/bcachefs/mean_and_variance.c +++ b/fs/bcachefs/mean_and_variance.c @@ -62,6 +62,7 @@ EXPORT_SYMBOL_GPL(u128_div); /** * mean_and_variance_get_mean() - get mean from @s + * @s: mea...
44fd13a4c68e87953ccd827e764fa566ddcbbcf5
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fixes for rust bindgen
Problem Details: bindgen doesn't seem to like u128 or DECLARE_FLEX_ARRAY(), but we can hack around them. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/mean_and_variance.h b/fs/bcachefs/mean_and_variance.h index 647505010b39..b2be565bb8f2 100644 --- a/fs/bcachefs/mean_and_variance.h +++ b/fs/bcachefs/mean_and_variance.h @@ -12,9 +12,12 @@ /* * u128_u: u128 user mode, because not all architectures support a real int128 * type + * +...
a7dc10ce689a6224c1601d5d2e4ca57dd8cce9f6
Analyze and fix the following issue in the Linux kernel code: bcachefs: Make sure allocation failure errors are logged
Problem Details: The previous patch fixed a bug in allocation path error handling, and it would've been noticed sooner had it been logged properly. Generally speaking, errors that shouldn't happen in normal operation and are being returned up the stack should be logged: the write path was already logging IO errors, bu...
```diff diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h index fe65dfea0780..53a2624176ab 100644 --- a/fs/bcachefs/bcachefs.h +++ b/fs/bcachefs/bcachefs.h @@ -326,6 +326,12 @@ do { \ bch_err(_c, "%s(): error %s", __func__, bch2_err_str(_ret));\ } while (0) +#define bch_err_fn_ratelimited(_c, _...
4c26dea1c096138b6e7c49c4886e68fbf6013217
Analyze and fix the following issue in the Linux kernel code: bcachefs: Replace zero-length array with flex-array member and use __counted_by
Problem Details: Fake flexible arrays (zero-length and one-element arrays) are deprecated, and should be replaced by flexible-array members. So, replace zero-length array with a flexible-array member in `struct bch_ioctl_fsck_offline`. Also annotate array `devs` with `__counted_by()` to prepare for the coming implemen...
```diff diff --git a/fs/bcachefs/bcachefs_ioctl.h b/fs/bcachefs/bcachefs_ioctl.h index 21f81b16f24e..4b8fba754b1c 100644 --- a/fs/bcachefs/bcachefs_ioctl.h +++ b/fs/bcachefs/bcachefs_ioctl.h @@ -397,7 +397,7 @@ struct bch_ioctl_fsck_offline { __u64 flags; __u64 opts; /* string */ __u64 nr_devs; - __u64 d...
e06af20719a439730a588155e3b28d327a57d951
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix userspace build errors
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h index db246d00c607..f6b621412ee4 100644 --- a/fs/bcachefs/bcachefs.h +++ b/fs/bcachefs/bcachefs.h @@ -193,6 +193,7 @@ #include <linux/mutex.h> #include <linux/percpu-refcount.h> #include <linux/percpu-rwsem.h> +#include <linux/refcount.h> #include...
249bf593e84e0b4652d2cdb9884b97bc21b59d9f
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix snapshot.c assertion for online fsck
Problem Details: c->curr_recovery_pass can go backwards; this adds a non rewinding version, c->recovery_pass_done. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h index b42e3854c51f..f33f510463d1 100644 --- a/fs/bcachefs/bcachefs.h +++ b/fs/bcachefs/bcachefs.h @@ -1057,7 +1057,10 @@ struct bch_fs { enum bch_recovery_pass curr_recovery_pass; /* bitmap of explicitly enabled recovery passes: */ u64 recover...
b56cee70e75e2edcbb92eb3d9357fae5df857b01
Analyze and fix the following issue in the Linux kernel code: bcachefs: six lock: fix typos
Problem Details: Fix a few typos in the six.h header file. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Kent Overstreet <kent.overstreet@linux.dev> Cc: Brian Foster <bfoster@redhat.com> Cc: linux-bcachefs@vger.kernel.org Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/six.h b/fs/bcachefs/six.h index a7104ac1d35c..68d46fd7f391 100644 --- a/fs/bcachefs/six.h +++ b/fs/bcachefs/six.h @@ -15,7 +15,7 @@ * will have to take write locks for the full duration of the operation. * * But by adding an intent state, which is exclusive with other intent locks...
be1fa63de867aa26f2f57e6f5db2a358f6da5ad1
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_read_btree()
Problem Details: In the debugfs code, we had an incorrect use of drop_locks_do(); on transaction restart we don't want to restart the current loop iteration, since we've already emitted the current key to the buffer for userspace. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c index 57c5128db173..c45421a2f408 100644 --- a/fs/bcachefs/debug.c +++ b/fs/bcachefs/debug.c @@ -385,7 +385,8 @@ static ssize_t bch2_read_btree(struct file *file, char __user *buf, BTREE_ITER_ALL_SNAPSHOTS, k, ({ bch2_bkey_val_to_text(&i->buf, i->c...
a0acc24fedbe067b30f4320daa8d63b404f6ccd9
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix open coded set_btree_iter_dontneed()
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c index a7e6554cc7dd..d99f38c1e7f9 100644 --- a/fs/bcachefs/alloc_foreground.c +++ b/fs/bcachefs/alloc_foreground.c @@ -377,7 +377,7 @@ static struct open_bucket *try_alloc_bucket(struct btree_trans *trans, struct bc ob = __try_alloc...
d9e14a4eb9902bac1e6fb779eb6c41629652cbd8
Analyze and fix the following issue in the Linux kernel code: bcachefs: remove sb lock and flags update on explicit shutdown
Problem Details: bcachefs grabs s_umount and sets SB_RDONLY when the fs is shutdown via the ioctl() interface. This has a couple issues related to interactions between shutdown and freeze: 1. The flags == FSOP_GOING_FLAGS_DEFAULT case is a deadlock vector because freeze_bdev() calls into freeze_super(), which also ...
```diff diff --git a/fs/bcachefs/fs-ioctl.c b/fs/bcachefs/fs-ioctl.c index 14d5cc6f90d7..e0a19a73c8e1 100644 --- a/fs/bcachefs/fs-ioctl.c +++ b/fs/bcachefs/fs-ioctl.c @@ -285,34 +285,26 @@ static int bch2_ioc_goingdown(struct bch_fs *c, u32 __user *arg) bch_notice(c, "shutdown by ioctl type %u", flags); - down_wr...
3398124444b90079a09374ab10444cd937b72ae1
Analyze and fix the following issue in the Linux kernel code: bcachefs: Improve trace_trans_restart_would_deadlock
Problem Details: In the CI, we're seeing tests failing due to excessive would_deadlock transaction restarts - the tracepoint now includes the lock cycle that occured. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index f83fab9e62fc..b304c7fc58b1 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -3054,6 +3054,7 @@ void bch2_btree_trans_to_text(struct printbuf *out, struct btree_trans *trans) struct btree_path *path; struct btree_bk...
56db2429511e14291bdb0105899e02f074885d4d
Analyze and fix the following issue in the Linux kernel code: bcachefs: Improve btree write buffer tracepoints
Problem Details: - add a tracepoint for write_buffer_flush_sync; this is expensive - fix the write_buffer_flush_slowpath tracepoint Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h index 41fa8b9b69f4..545df77bcd46 100644 --- a/fs/bcachefs/bcachefs_format.h +++ b/fs/bcachefs/bcachefs_format.h @@ -1578,7 +1578,9 @@ struct bch_sb_field_disk_groups { x(write_super, 73) \ x(trans_restart_would_deadlock_recursion...
225879f403c6196624f0ed5c118b2cdd7de02e64
Analyze and fix the following issue in the Linux kernel code: bcachefs: clean up one inconsistent indenting
Problem Details: fs/bcachefs/journal_io.c:1843 bch2_journal_write_pick_flush() warn: inconsistent indenting Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7585 Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Kent Overstreet <kent.overstreet@...
```diff diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index 30fb8e950613..c46b3bf09fd5 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -1850,7 +1850,7 @@ static int bch2_journal_write_pick_flush(struct journal *j, struct journal_buf * (!w->must_flush && (jiffies -...
5fd24caf572db0d1ccb03d3132fa1e249e84dd8b
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix userspace bch2_prt_datetime()
Problem Details: ctime_r() outputs a newline, which we don't want. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 8d580d5a9c4d..e85b1f467295 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -322,6 +322,7 @@ void bch2_prt_datetime(struct printbuf *out, time64_t sec) time_t t = sec; char buf[64]; ctime_r(&t, buf); + strim(buf); prt_str(out, buf); ...
cd404e5b05eb40f3ff27ab9d796f41f0a3b5a2c4
Analyze and fix the following issue in the Linux kernel code: bcachefs: backpointers fsck no longer uses BTREE_ITER_ALL_LEVELS
Problem Details: It appears that BTREE_ITER_ALL_LEVELS is racy with concurrent interior node btree updates; unfortunate but not terribly surprising it's a difficult problem - that was the original reason for gc_lock. BTREE_ITER_ALL_LEVELS will probably be deleted in a subsequent patch, this changes backpointers fsck t...
```diff diff --git a/fs/bcachefs/backpointers.c b/fs/bcachefs/backpointers.c index 5025a71ad685..69bd6c281d1a 100644 --- a/fs/bcachefs/backpointers.c +++ b/fs/bcachefs/backpointers.c @@ -426,11 +426,13 @@ static int check_bp_exists(struct btree_trans *trans, memcmp(bkey_s_c_to_backpointer(bp_k).v, &bp, sizeof(bp)...
cd5bd1628284f874ad6180be1f67e9b6739cc02a
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix redundant variable initialization
Problem Details: path->level was being read, but never used. Reported-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index da594e006769..bf4d2ade4535 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -1214,8 +1214,6 @@ __bch2_btree_path_set_pos(struct btree_trans *trans, struct btree_path *path, struct bpos new_pos, bool intent,...
573224301c56ae6c169b77cc003be7690da70b9b
Analyze and fix the following issue in the Linux kernel code: bcachefs: Make journal replay more efficient
Problem Details: Journal replay now first attempts to replay keys in sorted order, similar to how the btree write buffer flush path works. Any keys that can not be replayed due to journal deadlock are then left for later and replayed in journal order, unpinning journal entries as we go. Signed-off-by: Kent Overstreet...
```diff diff --git a/fs/bcachefs/errcode.h b/fs/bcachefs/errcode.h index 9ce29681eec9..d49a4994666d 100644 --- a/fs/bcachefs/errcode.h +++ b/fs/bcachefs/errcode.h @@ -73,7 +73,6 @@ x(ENOMEM, ENOMEM_fsck_add_nlink) \ x(ENOMEM, ENOMEM_journal_key_insert) \ x(ENOMEM, ENOMEM_journal_keys_sort) \ - x(ENOMEM,...
df8e13ccf3c0cc2b16e931f71ef69834db71eda9
Analyze and fix the following issue in the Linux kernel code: bcachefs: Add an assertion in bch2_journal_pin_set()
Problem Details: Previously, bch2_journal_pin_set() would silently ignore a request to pin a journal sequence number that was no longer dirty, because it was used internally by bch2_journal_pin_copy() which could race with the src pin being flushed. Split these apart so that we can properly assert that @seq is a curre...
```diff diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c index ec712104addb..f2668d9d8e24 100644 --- a/fs/bcachefs/journal_reclaim.c +++ b/fs/bcachefs/journal_reclaim.c @@ -367,15 +367,34 @@ static enum journal_pin_type journal_pin_type(journal_pin_flush_fn fn) return JOURNAL_PIN_other; } ...
fa5df9e7d5a85507cc01f32815854993983c1ff5
Analyze and fix the following issue in the Linux kernel code: bcachefs: Include average write size in sysfs journal_debug
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index 8cf238be6213..5df417cd6743 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -1262,6 +1262,7 @@ void __bch2_journal_debug_to_text(struct printbuf *out, struct journal *j) union journal_res_state s; struct bch_dev *ca; unsigne...
09e0153b72bfba618e6ceedb5dd883cdeed911af
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix warning when building in userspace
Problem Details: bch_err() doesn't reference the fs arg in userspace Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c index 12907beda98c..9cedc1755d34 100644 --- a/fs/bcachefs/btree_trans_commit.c +++ b/fs/bcachefs/btree_trans_commit.c @@ -361,7 +361,6 @@ noinline static int btree_key_can_insert_cached_slowpath(struct btree_trans *trans, unsigned...
7d9ae04e3987648b99b9ac8036178a75fb913dd6
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix locking when checking freespace btree
Problem Details: On transaction restart, we weren't re-validating the hole we saw. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 1fec0e67891f..6002bd0cf89c 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -1212,7 +1212,7 @@ fsck_err: return ret; } -static noinline_for_stack int __bch2_check_discard_freespace_key(stru...
30418de09e6bda5478a6cfb7c1a54e128b7e2a22
Analyze and fix the following issue in the Linux kernel code: bcachefs: Flush fsck errors before running twice
Problem Details: It's confusing if we run fsck a second time (in debug mode, to verify the second run is clean), but errors are still ratelimited from the first run. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 5cf7d0532002..70add8274a95 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -924,6 +924,8 @@ use_clean: test_bit(BCH_FS_ERRORS_FIXED, &c->flags) && !test_bit(BCH_FS_ERRORS_NOT_FIXED, &c->flags) && !test_bit(B...
84f1638795da1ff2084597de4251e9054f1ad728
Analyze and fix the following issue in the Linux kernel code: bcachefs: bch_sb_field_downgrade
Problem Details: Add a new superblock section that contains a list of { minor version, recovery passes, errors_to_fix } that is - a list of recovery passes that must be run when downgrading past a given version, and a list of errors to silently fix. The upcoming disk accounting rewrite is not going to be fully comp...
```diff diff --git a/fs/bcachefs/Makefile b/fs/bcachefs/Makefile index ed550a40463e..b81268418174 100644 --- a/fs/bcachefs/Makefile +++ b/fs/bcachefs/Makefile @@ -71,6 +71,7 @@ bcachefs-y := \ reflink.o \ replicas.o \ sb-clean.o \ + sb-downgrade.o \ sb-errors.o \ sb-members.o \ siphash.o \ diff --gi...
d9534cc9fc455214e857bc1d32f44d5a229dc602
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix buffer overflow in nocow write path
Problem Details: BCH_REPLICAS_MAX isn't the actual maximum number of pointers in an extent, it's the maximum number of dirty pointers. We don't have a real restriction on the number of cached pointers, and we don't want a fixed size array here anyways - so switch to DARRAY_PREALLOCATED(). Signed-off-by: Kent Overstre...
```diff diff --git a/fs/bcachefs/io_write.c b/fs/bcachefs/io_write.c index 8ede46b1e354..8c8cb1541ac9 100644 --- a/fs/bcachefs/io_write.c +++ b/fs/bcachefs/io_write.c @@ -1216,6 +1216,12 @@ static CLOSURE_CALLBACK(bch2_nocow_write_done) bch2_write_done(cl); } +struct bucket_to_lock { + struct bpos b; + unsigned ...
f87bf892ea9848696ddfd184964d303202dd19dd
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix setting version_upgrade_complete
Problem Details: If a superblock write hasn't happened (i.e. we never had to go rw), then c->sb.version will be out of date w.r.t. c->disk_sb.sb->version. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index c7d9074c82d9..c2f183d2ffe8 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -868,8 +868,8 @@ use_clean: } mutex_lock(&c->sb_lock); - if (BCH_SB_VERSION_UPGRADE_COMPLETE(c->disk_sb.sb) != c->sb.version) { - SET_BCH_SB_VE...
f2eb8434e4fec891ae842183b9193ae759ee6d78
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix invalid free in dio write path
Problem Details: turns out iterate_iovec() mutates __iov, we need to save our own copy Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> Reported-by: Marcin Mirosław <marcin@mejor.pl>
```diff diff --git a/fs/bcachefs/fs-io-direct.c b/fs/bcachefs/fs-io-direct.c index 9a479e4de6b3..84e20c3ada6c 100644 --- a/fs/bcachefs/fs-io-direct.c +++ b/fs/bcachefs/fs-io-direct.c @@ -216,11 +216,11 @@ struct dio_write { struct address_space *mapping; struct bch_inode_info *inode; struct mm_struct *mm; + co...
fa014953f9409edd32b04cb5c0f4167b8a537e65
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix extents iteration + snapshots interaction
Problem Details: peek_upto() checks against the end position and bails out before FILTER_SNAPSHOTS checks; this is because if we end up at a different inode number than the original search key none of the keys we see might be visibile in the current snapshot - we might be looking at inode in a completely different subv...
```diff diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index 6be79129738d..da594e006769 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -2085,18 +2085,16 @@ struct bkey_s_c bch2_btree_iter_peek_upto(struct btree_iter *iter, struct bpos e goto out_no_locked; /* - * it...
28f4c58045ede40c44d331b9a6c9a6a41eb8e9a9
Analyze and fix the following issue in the Linux kernel code: afs: Fix offline and busy message emission
Problem Details: The current code assumes that offline and busy volume states apply to all instances of a volume, not just the one on the server that returned VOFFLINE or VBUSY and will emit a notice to dmesg suggesting that the entire volume is unavailable. Fix that by moving the flags recording this to the afs_serve...
```diff diff --git a/fs/afs/internal.h b/fs/afs/internal.h index e3e373c1fecf..a6a4fc417dba 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h @@ -612,6 +612,8 @@ struct afs_server_entry { time64_t cb_expires_at; /* Time at which volume-level callback expires */ unsigned long flags; #define AFS_SE_EXCLUDED ...
495f2ae9e3552c30f7b83be3d142a932885d506e
Analyze and fix the following issue in the Linux kernel code: afs: Fix fileserver rotation
Problem Details: Fix the fileserver rotation so that it doesn't use RTT as the basis for deciding which server and address to use as this doesn't necessarily give a good indication of the best path. Instead, use the configurable preference list in conjunction with whatever probes have succeeded at the time of looking....
```diff diff --git a/fs/afs/fs_operation.c b/fs/afs/fs_operation.c index cecc44af6a5f..3546b087e791 100644 --- a/fs/afs/fs_operation.c +++ b/fs/afs/fs_operation.c @@ -229,7 +229,6 @@ void afs_wait_for_operation(struct afs_operation *op) */ int afs_put_operation(struct afs_operation *op) { - struct afs_endpoint_stat...
dd94888938f8fefc6ee29ef57560c1e87cc3e05e
Analyze and fix the following issue in the Linux kernel code: afs: Fix comment in afs_do_lookup()
Problem Details: Fix the comment in afs_do_lookup() that says that slot 0 is used for the fid being looked up and slot 1 is used for the directory. It's actually done the other way round. Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org
```diff diff --git a/fs/afs/dir.c b/fs/afs/dir.c index ecb889a269fb..e232f713ece1 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -807,8 +807,8 @@ static struct inode *afs_do_lookup(struct inode *dir, struct dentry *dentry, cookie->fids[i].vid = dvnode->fid.vid; cookie->ctx.actor = afs_lookup_filldir; cookie->na...
9c476269bff2908a20930c58085bf0b05ebd569a
Analyze and fix the following issue in the Linux kernel code: r8169: Fix PCI error on system resume
Problem Details: Some r8168 NICs stop working upon system resume: [ 688.051096] r8169 0000:02:00.1 enp2s0f1: rtl_ep_ocp_read_cond == 0 (loop: 10, delay: 10000). [ 688.175131] r8169 0000:02:00.1 enp2s0f1: Link is Down ... [ 691.534611] r8169 0000:02:00.1 enp2s0f1: PCI error (cmd = 0x0407, status_errs = 0x0000) Not ...
```diff diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index bb787a52bc75..81fd31f6fac4 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -1211,7 +1211,7 @@ static void rtl8168ep_driver_start(struct rtl8169_priva...
b901a4e276943f61e11ddb597a0abc1e7dfadf0f
Analyze and fix the following issue in the Linux kernel code: net/tcp_sigpool: Use kref_get_unless_zero()
Problem Details: The freeing and re-allocation of algorithm are protected by cpool_mutex, so it doesn't fix an actual use-after-free, but avoids a deserved refcount_warn_saturate() warning. A trivial fix for the racy behavior. Fixes: 8c73b26315aa ("net/tcp: Prepare tcp_md5sig_pool for TCP-AO") Suggested-by: Eric Duma...
```diff diff --git a/net/ipv4/tcp_sigpool.c b/net/ipv4/tcp_sigpool.c index 55b310a722c7..8512cb09ebc0 100644 --- a/net/ipv4/tcp_sigpool.c +++ b/net/ipv4/tcp_sigpool.c @@ -162,9 +162,8 @@ int tcp_sigpool_alloc_ahash(const char *alg, size_t scratch_size) if (strcmp(cpool[i].alg, alg)) continue; - if (kref_read(...
8fcb0382af6f1ef50936f1be05b8149eb2f88496
Analyze and fix the following issue in the Linux kernel code: net: sched: em_text: fix possible memory leak in em_text_destroy()
Problem Details: m->data needs to be freed when em_text_destroy is called. Fixes: d675c989ed2d ("[PKT_SCHED]: Packet classification based on textsearch (ematch)") Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David...
```diff diff --git a/net/sched/em_text.c b/net/sched/em_text.c index 6f3c1fb2fb44..f176afb70559 100644 --- a/net/sched/em_text.c +++ b/net/sched/em_text.c @@ -97,8 +97,10 @@ retry: static void em_text_destroy(struct tcf_ematch *m) { - if (EM_TEXT_PRIV(m) && EM_TEXT_PRIV(m)->config) + if (EM_TEXT_PRIV(m) && EM_TEXT_...
95ea83829e5f406b15175eb445b89000c2558168
Analyze and fix the following issue in the Linux kernel code: dt-bindings: display: ssd132x: Add vendor prefix to width and height
Problem Details: Commit 2d23e7d6bacb ("dt-bindings: display: Add SSD132x OLED controllers") used the wrong properties for width and height, instead of the correct "solomon,width" and "solomon,height" properties. Fix this by adding the vendor prefix to the width and height properties. Fixes: 2d23e7d6bacb ("dt-bindings...
```diff diff --git a/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml index 37975ee61c5a..dd7939989cf4 100644 --- a/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml +++ b/Documentation/devicetree/bindings/display/solomon,ssd132...
a72aa8985c41ec241263b802857d84f4c90a8694
Analyze and fix the following issue in the Linux kernel code: dt-bindings: display: ssd1307fb: Add vendor prefix to width and height
Problem Details: The commit 591825fba8a2 ("dt-bindings: display: ssd1307fb: Remove default width and height values") used the wrong properties for width and height, instead of the correct "solomon,width" and "solomon,height" properties. Fix this by adding the vendor prefix to the width and height properties. Fixes: 5...
```diff diff --git a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml index 3afbb52d1b7f..153ff86fb405 100644 --- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml +++ b/Documentation/devicetree/bindings/display/solomon,...
9c334eb9ce886247567573074b13c5ac29d1a41a
Analyze and fix the following issue in the Linux kernel code: get_maintainer: correctly parse UTF-8 encoded names in files
Problem Details: While the script correctly extracts UTF-8 encoded names from the MAINTAINERS file, the regular expressions damage my name when parsing from .yaml files. Fix this by replacing the Latin-1-compatible regular expressions with the unicode property matcher \p{L}, which matches on any letter according to th...
```diff diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 16d8ac6005b6..dac38c6e3b1c 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -20,6 +20,7 @@ use Getopt::Long qw(:config no_auto_abbrev); use Cwd; use File::Find; use File::Spec::Functions; +use open qw(:std :enco...
d05cb470663a2a1879277e544f69e660208f08f2
Analyze and fix the following issue in the Linux kernel code: ftrace: Fix modification of direct_function hash while in use
Problem Details: Masami Hiramatsu reported a memory leak in register_ftrace_direct() where if the number of new entries are added is large enough to cause two allocations in the loop: for (i = 0; i < size; i++) { hlist_for_each_entry(entry, &hash->buckets[i], hlist) { ne...
```diff diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 8de8bec5f366..b01ae7d36021 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1183,18 +1183,19 @@ static void __add_hash_entry(struct ftrace_hash *hash, hash->count++; } -static int add_hash_entry(struct ftrace_hash *hash, uns...
7991ed43587d1106315208cc289c851d6915d4a3
Analyze and fix the following issue in the Linux kernel code: x86/alternative: Correct feature bit debug output
Problem Details: In https://lore.kernel.org/r/20231206110636.GBZXBVvCWj2IDjVk4c@fat_crate.local I wanted to adjust the alternative patching debug output to the new changes introduced by da0fe6e68e10 ("x86/alternative: Add indirect call patching") but removed the '*' which denotes the ->x86_capability word. The ...
```diff diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index f26983a3e035..f7ea108fbd88 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -498,7 +498,7 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start, continue; } - DPRINT...
66e82d219924f6112509f7e8f8e687fcc81a16e3
Analyze and fix the following issue in the Linux kernel code: ALSA: mark all struct bus_type as const
Problem Details: Now that the driver core can properly handle constant struct bus_type, move all of the sound subsystem struct bus_type structures as const, placing them into read-only memory which can not be modified at runtime. Note, this fixes a duplicate definition of ac97_bus_type, which somehow was declared exte...
```diff diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index c495c6d5fbe0..4bd3be3a3192 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h @@ -410,7 +410,7 @@ int snd_ac97_pcm_close(struct ac97_pcm *pcm); int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime); ...
47a145c03484d33e65d773169d5ca1b9fe2a492e
Analyze and fix the following issue in the Linux kernel code: drm/rockchip: inno_hdmi: Fix video timing
Problem Details: The controller wants the difference between *total and *sync_start in the HDMI_VIDEO_EXT_*DELAY registers. Otherwise the signal is very unstable for certain non-VIC modes. See downstream commit [0]. [0] https://github.com/rockchip-linux/kernel/commit/8eb559f2502c Fixes: 412d4ae6b7a5 ("drm/rockchip: h...
```diff diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index f6d819803c0e..50c984ac107d 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -411,7 +411,7 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, hdmi_write...
dcea1bd45e6d111cc8fc1aaefa7e31694089bda3
Analyze and fix the following issue in the Linux kernel code: mlxbf_gige: fix receive packet race condition
Problem Details: Under heavy traffic, the BlueField Gigabit interface can become unresponsive. This is due to a possible race condition in the mlxbf_gige_rx_packet function, where the function exits with producer and consumer indices equal but there are remaining packet(s) to be processed. In order to prevent this situ...
```diff diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c index 0d5a41a2ae01..227d01cace3f 100644 --- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c +++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c @@ -267,6 +267,13...
8586a5d217ef7bfeee24943c600a8a7890d6f477
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: Fix led pinctrl of lubancat 1
Problem Details: According to the schematics, the gpio control sys_led is GPIO0_C5. Fixes: 8d94da58de53 ("arm64: dts: rockchip: Add EmbedFire LubanCat 1") Reported-by: Zhang Ning <zhangn1985@outlook.com> Closes: https://lore.kernel.org/linux-rockchip/OS0P286MB06412D049D8BF7B063D41350CD95A@OS0P286MB0641.JPNP286.PROD.OU...
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts b/arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts index 1c6d83b47cd2..6ecdf5d28339 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts +++ b/arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts @@ -455,7 +455,7 @@ &pinctrl { leds { ...
6dcde5d5f248291c5ff6cbe00a7fa6ae400d1aa9
Analyze and fix the following issue in the Linux kernel code: watchdog/hardlockup: adopt softlockup logic avoiding double-dumps
Problem Details: Patch series "watchdog: Better handling of concurrent lockups". When we get multiple lockups at roughly the same time, the output in the kernel logs can be very confusing since the reports about the lockups end up interleaved in the logs. There is some code in the kernel to try to handle this but it ...
```diff diff --git a/kernel/watchdog.c b/kernel/watchdog.c index bf30a6fac665..b4fd2f12137f 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -91,7 +91,7 @@ static DEFINE_PER_CPU(atomic_t, hrtimer_interrupts); static DEFINE_PER_CPU(int, hrtimer_interrupts_saved); static DEFINE_PER_CPU(bool, watchdog_hardlocku...
2861b37732627d7d115d77585ce4853f25cf332d
Analyze and fix the following issue in the Linux kernel code: kexec_core: fix the assignment to kimage->control_page
Problem Details: image->control_page represents the starting address for allocating the next control page, while hole_end represents the address of the last valid byte of the currently allocated control page. This bug actually does not affect the correctness of allocating control pages, because image->control_page is ...
```diff diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index 2f039a7d9af9..a08031b57a61 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -457,7 +457,7 @@ static struct page *kimage_alloc_crash_control_pages(struct kimage *image, /* If I don't overlap any segments I have found my hole! */ if (...
3177e6315b12839ea7be2810ae6b461b123e026e
Analyze and fix the following issue in the Linux kernel code: x86/kexec: fix incorrect end address passed to kernel_ident_mapping_init()
Problem Details: kernel_ident_mapping_init() takes an exclusive memory range [pstart, pend) where pend is not included in the range, while res represents an inclusive memory range [start, end] where end is considered part of the range. Passing [start, end] rather than [start, end+1) to kernel_ident_mapping_init() may ...
```diff diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 6f8df998890e..bc0a5348b4a6 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c @@ -44,7 +44,7 @@ static int mem_region_callback(struct resource *res, void *arg) struct init_pgtable_d...
8e226a0a8dc8b80b792338750cd5d26675ce29bc
Analyze and fix the following issue in the Linux kernel code: nilfs2: cpfile: fix some kernel-doc warnings
Problem Details: Correct the function parameter names for nilfs_cpfile_get_info(): cpfile.c:564: warning: Function parameter or member 'cnop' not described in 'nilfs_cpfile_get_cpinfo' cpfile.c:564: warning: Function parameter or member 'mode' not described in 'nilfs_cpfile_get_cpinfo' cpfile.c:564: warning: Function ...
```diff diff --git a/fs/nilfs2/cpfile.c b/fs/nilfs2/cpfile.c index 9ebefb3acb0e..39136637f715 100644 --- a/fs/nilfs2/cpfile.c +++ b/fs/nilfs2/cpfile.c @@ -552,11 +552,29 @@ static ssize_t nilfs_cpfile_do_get_ssinfo(struct inode *cpfile, __u64 *cnop, } /** - * nilfs_cpfile_get_cpinfo - - * @cpfile: - * @cno: - * @ci...
5f981878c71eaa8dc5563805152bd129a73a90be
Analyze and fix the following issue in the Linux kernel code: stacktrace: fix kernel-doc typo
Problem Details: Change @task to @tsk to prevent kernel-doc warnings: kernel/stacktrace.c:138: warning: Excess function parameter 'task' description in 'stack_trace_save_tsk' kernel/stacktrace.c:138: warning: Function parameter or member 'tsk' not described in 'stack_trace_save_tsk' Link: https://lkml.kernel.org/r/20...
```diff diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c index 4f65824879ab..afb3c116da91 100644 --- a/kernel/stacktrace.c +++ b/kernel/stacktrace.c @@ -126,7 +126,7 @@ EXPORT_SYMBOL_GPL(stack_trace_save); /** * stack_trace_save_tsk - Save a task stack trace into a storage array - * @task: The task to examin...
f22c3634361c970ca49c389f4c3dacb41295bf0d
Analyze and fix the following issue in the Linux kernel code: scripts/checkstack.pl: fix no space expression between sp and offset
Problem Details: When I use older version aarch64 objdump (2.24) to disassemble aarch64 vmlinux, I get the result like below. There is no space between sp and offset. ffff800008010000 <dw_apb_ictl_handle_irq>: ffff800008010000: d503233f hint #0x19 ffff800008010004: a9bc7bfd stp x29, x...
```diff diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index 8e04659ef463..14ce31f732ee 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl @@ -56,7 +56,7 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_stack); if ($arch =~ '^(aarch|arm)64$') { #ffffffc0006325cc: a9bb7bfd ...
22bb6bcd4c2b2f22865bdfdd7c772405ed3cbfd3
Analyze and fix the following issue in the Linux kernel code: x86/kexec: fix incorrect argument passed to kexec_dprintk()
Problem Details: kexec_dprintk() expects the last argument to be kbuf.memsz, but the actual argument being passed is kbuf.bufsz. Although these two values are currently equal, it is better to pass the correct one, in case these two values become different in the future. Link: https://lkml.kernel.org/r/20231220154105....
```diff diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c index 4a77d5dd4bce..2a422e00ed4b 100644 --- a/arch/x86/kernel/kexec-bzimage64.c +++ b/arch/x86/kernel/kexec-bzimage64.c @@ -496,7 +496,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, goto out_free_params; ...
18d565ea95fe553f442c5bbc5050415bab3c3fa4
Analyze and fix the following issue in the Linux kernel code: kexec_file: fix incorrect temp_start value in locate_mem_hole_top_down()
Problem Details: temp_end represents the address of the last available byte. Therefore, the starting address of the memory segment with temp_end as its last available byte and a size of `kbuf->memsz`, that is, the value of temp_start, should be `temp_end - kbuf->memsz + 1` instead of `temp_end - kbuf->memsz`. Additio...
```diff diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index aca5f3668f4c..bef2f6f2571b 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -434,11 +434,11 @@ static int locate_mem_hole_top_down(unsigned long start, unsigned long end, unsigned long temp_start, temp_end; temp_end = min(end, kbuf-...
816d334afa85c836080b41bb6238aea845615ad9
Analyze and fix the following issue in the Linux kernel code: kexec: modify the meaning of the end parameter in kimage_is_destination_range()
Problem Details: The end parameter received by kimage_is_destination_range() should be the last valid byte address of the target memory segment plus 1. However, in the locate_mem_hole_bottom_up() and locate_mem_hole_top_down() functions, the corresponding value passed to kimage_is_destination_range() is the last valid...
```diff diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index 6e0f022987ff..2f039a7d9af9 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -278,8 +278,8 @@ int kimage_is_destination_range(struct kimage *image, unsigned long mstart, mend; mstart = image->segment[i].mem; - mend = mstart + imag...
1ae41dffd48a700f4bf69e5377f4311de7d92b78
Analyze and fix the following issue in the Linux kernel code: mm/damon/vaddr: change asm-generic/mman-common.h to linux/mman.h
Problem Details: asm-generic/mman-common.h can be replaced by linux/mman.h and the file will still build correctly. It is an asm-generic file which should be avoided if possible. Link: https://lkml.kernel.org/r/20231221-asmgenericvaddr-v1-1-742b170c914e@google.com Fixes: 6dea8add4d28 ("mm/damon/vaddr: support DAMON-b...
```diff diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c index a67454b825dc..381559e4a1fa 100644 --- a/mm/damon/vaddr.c +++ b/mm/damon/vaddr.c @@ -7,9 +7,9 @@ #define pr_fmt(fmt) "damon-va: " fmt -#include <asm-generic/mman-common.h> #include <linux/highmem.h> #include <linux/hugetlb.h> +#include <linux/mman.h> ...
a3fbe303ec9db45dbabc923ea9c5323900176079
Analyze and fix the following issue in the Linux kernel code: kasan: simplify kasan_complete_mode_report_info for tag-based modes
Problem Details: memcpy the alloc/free tracks when collecting the information about a bad access instead of copying fields one by one. Link: https://lkml.kernel.org/r/20231221183540.168428-4-andrey.konovalov@linux.dev Fixes: 5d4c6ac94694 ("kasan: record and report more information") Signed-off-by: Andrey Konovalov <an...
```diff diff --git a/mm/kasan/report_tags.c b/mm/kasan/report_tags.c index 688b9d70b04a..d15f8f580e2c 100644 --- a/mm/kasan/report_tags.c +++ b/mm/kasan/report_tags.c @@ -27,15 +27,6 @@ static const char *get_common_bug_type(struct kasan_report_info *info) return "invalid-access"; } -#ifdef CONFIG_KASAN_EXTRA_INFO...
fd4064f69708bc84d960b666896715fe86882c85
Analyze and fix the following issue in the Linux kernel code: kasan: simplify saving extra info into tracks
Problem Details: Avoid duplicating code for saving extra info into tracks: reuse the common function for this. Link: https://lkml.kernel.org/r/20231221183540.168428-3-andrey.konovalov@linux.dev Fixes: 5d4c6ac94694 ("kasan: record and report more information") Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Rev...
```diff diff --git a/mm/kasan/common.c b/mm/kasan/common.c index 86adf80cc11a..a486e9b1ac68 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c @@ -48,7 +48,7 @@ depot_stack_handle_t kasan_save_stack(gfp_t flags, depot_flags_t depot_flags) return stack_depot_save_flags(entries, nr_entries, flags, depot_flags); } ...
04afc540e58e8f66fd85b0b88af3e8ce286be17c
Analyze and fix the following issue in the Linux kernel code: kasan: reuse kasan_track in kasan_stack_ring_entry
Problem Details: Avoid duplicating fields of kasan_track in kasan_stack_ring_entry: reuse the structure. Link: https://lkml.kernel.org/r/20231221183540.168428-2-andrey.konovalov@linux.dev Fixes: 5d4c6ac94694 ("kasan: record and report more information") Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Reviewed-...
```diff diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index acc1a9410f0d..a280bb04c0e6 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -293,13 +293,8 @@ struct kasan_free_meta { struct kasan_stack_ring_entry { void *ptr; size_t size; - u32 pid; - depot_stack_handle_t stack; + struct kasan_track track; ...
f6940e8adc64f584dcfb2960f6e4b6a54ea9c508
Analyze and fix the following issue in the Linux kernel code: kasan: clean up kasan_cache_create
Problem Details: Reorganize the code to avoid nested if/else checks to improve the readability. Also drop the confusing comments about KMALLOC_MAX_SIZE checks: they are relevant for both SLUB and SLAB (originally, the comments likely confused KMALLOC_MAX_SIZE with KMALLOC_MAX_CACHE_SIZE). Link: https://lkml.kernel.or...
```diff diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c index 55e6b5db2cae..5b3308127ce0 100644 --- a/mm/kasan/generic.c +++ b/mm/kasan/generic.c @@ -382,16 +382,11 @@ void kasan_cache_create(struct kmem_cache *cache, unsigned int *size, ok_size = *size; - /* Add alloc meta into redzone. */ + /* Add alloc me...
58ee788cb23738abd57d6327d0b5096df5a53d31
Analyze and fix the following issue in the Linux kernel code: kasan: respect CONFIG_KASAN_VMALLOC for kasan_flag_vmalloc
Problem Details: Never enable the kasan_flag_vmalloc static branch unless CONFIG_KASAN_VMALLOC is enabled. This does not fix any observable bugs (vmalloc annotations for the HW_TAGS mode are no-op with CONFIG_KASAN_VMALLOC disabled) but rather just cleans up the code. Link: https://lkml.kernel.org/r/3e5c933c8f6b59bd5...
```diff diff --git a/mm/kasan/hw_tags.c b/mm/kasan/hw_tags.c index 06141bbc1e51..80f11a3eccd5 100644 --- a/mm/kasan/hw_tags.c +++ b/mm/kasan/hw_tags.c @@ -57,7 +57,11 @@ enum kasan_mode kasan_mode __ro_after_init; EXPORT_SYMBOL_GPL(kasan_mode); /* Whether to enable vmalloc tagging. */ +#ifdef CONFIG_KASAN_VMALLOC ...
3067b919ed81e17b8b8fb932c43f200775b1d545
Analyze and fix the following issue in the Linux kernel code: kasan: clean up kasan_requires_meta
Problem Details: Currently, for Generic KASAN mode, kasan_requires_meta is defined to return kasan_stack_collection_enabled. Even though the Generic mode does not support disabling stack trace collection, kasan_requires_meta was implemented in this way to make it easier to implement the disabling for the Generic mode ...
```diff diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index 0e209b823b2c..38af25b9c89c 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -101,21 +101,21 @@ static inline bool kasan_sample_page_alloc(unsigned int order) #ifdef CONFIG_KASAN_GENERIC -/* Generic KASAN uses per-object metadata to store stack t...
a3c5cc5129ef55ac6c69f468e5ee6e4b0cd8179c
Analyze and fix the following issue in the Linux kernel code: selftests/mm: log run_vmtests.sh results in TAP format
Problem Details: When running tests on a CI system (e.g. LAVA) it is useful to output test results in TAP (Test Anything Protocol) format so that the CI can parse the fine-grained results to show regressions. Many of the mm selftest binaries already output using the TAP format. And the kselftests runner (run_kselfte...
```diff diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index 87f513f5cf91..246d53a5d7f2 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -5,6 +5,7 @@ # Kselftest framework requirement - SKIP code is 4. ksft_sk...
5ec8e8ea8b7783fab150cf86404fc38cb4db8800
Analyze and fix the following issue in the Linux kernel code: mm/sparsemem: fix race in accessing memory_section->usage
Problem Details: The below race is observed on a PFN which falls into the device memory region with the system memory configuration where PFN's are such that [ZONE_NORMAL ZONE_DEVICE ZONE_NORMAL]. Since normal zone start and end pfn contains the device memory PFN's as well, the compaction triggered will try on the dev...
```diff diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index ec73582e7d27..2efd3be484fd 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -1799,6 +1799,7 @@ static inline unsigned long section_nr_to_pfn(unsigned long sec) #define SUBSECTION_ALIGN_DOWN(pfn) ((pfn) & PAGE_SUBSECTION_MASK)...
91349f541e7daa6cce15e01e7ffe4fd63731ead9
Analyze and fix the following issue in the Linux kernel code: lib/stackdepot: fix comment in include/linux/stackdepot.h
Problem Details: As stack traces can now be evicted from the stack depot, remove the comment saying that they are never removed. Link: https://lkml.kernel.org/r/0ebe712d91f8d302a8947d3c9e9123bc2b1b8440.1703020707.git.andreyknvl@google.com Fixes: 108be8def46e ("lib/stackdepot: allow users to evict stack traces") Signed...
```diff diff --git a/include/linux/stackdepot.h b/include/linux/stackdepot.h index a6796f178913..adcbb8f23600 100644 --- a/include/linux/stackdepot.h +++ b/include/linux/stackdepot.h @@ -11,8 +11,6 @@ * SLUB_DEBUG needs 256 bytes per object for that). Since allocation and free * stack traces often repeat, using sta...
08d7c94d9635cf3fdffcab5f066d857efbad9507
Analyze and fix the following issue in the Linux kernel code: kasan: memset free track in qlink_free
Problem Details: Instead of only zeroing out the stack depot handle when evicting the free stack trace in qlink_free, zero out the whole track. Do this just to produce a similar effect for alloc and free meta. The other fields of the free track besides the stack trace handle are considered invalid at this point anyway...
```diff diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c index 265ca2bbe2dd..782e045da911 100644 --- a/mm/kasan/quarantine.c +++ b/mm/kasan/quarantine.c @@ -157,7 +157,7 @@ static void qlink_free(struct qlist_node *qlink, struct kmem_cache *cache) if (free_meta && *(u8 *)kasan_mem_to_shadow(object) ==...
a414d4286f3400aa05631c4931eb3feba83e29e8
Analyze and fix the following issue in the Linux kernel code: kasan: handle concurrent kasan_record_aux_stack calls
Problem Details: kasan_record_aux_stack can be called concurrently on the same object. This might lead to a race condition when rotating the saved aux stack trace handles, which in turns leads to incorrect accounting of stack depot handles and refcount underflows in the stack depot code. Fix by introducing a raw spin...
```diff diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c index 54e20b2bc3e1..55e6b5db2cae 100644 --- a/mm/kasan/generic.c +++ b/mm/kasan/generic.c @@ -25,6 +25,7 @@ #include <linux/sched.h> #include <linux/sched/task_stack.h> #include <linux/slab.h> +#include <linux/spinlock.h> #include <linux/stackdepot.h> #i...
a914d8d6cf204287aa2dfb9235d29d7944ad72a1
Analyze and fix the following issue in the Linux kernel code: lib/stackdepot: add printk_deferred_enter/exit guards
Problem Details: Patch series "lib/stackdepot, kasan: fixes for stack eviction series", v3. A few fixes for the stack depot eviction series ("stackdepot: allow evicting stack traces"). This patch (of 5): Stack depot functions can be called from various contexts that do allocations, including with console locks taken...
```diff diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 870cce2f4cbd..a0be5d05c7f0 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -506,12 +506,14 @@ depot_stack_handle_t stack_depot_save_flags(unsigned long *entries, bucket = &stack_table[hash & stack_hash_mask]; read_lock_irqsave(&pool_rwlock, fl...
7d4847ded24775a01cbe1e1a5292f132d27f158b
Analyze and fix the following issue in the Linux kernel code: mempool: skip slub_debug poisoning when KASAN is enabled
Problem Details: With the changes in the following patch, KASAN starts saving its metadata within freed mempool elements. Thus, skip slub_debug poisoning and checking of mempool elements when KASAN is enabled. Corruptions of freed mempool elements will be detected by KASAN anyway. Link: https://lkml.kernel.org/r/98a...
```diff diff --git a/mm/mempool.c b/mm/mempool.c index 7e1c729f292b..1fd39478c85e 100644 --- a/mm/mempool.c +++ b/mm/mempool.c @@ -56,6 +56,10 @@ static void __check_element(mempool_t *pool, void *element, size_t size) static void check_element(mempool_t *pool, void *element) { + /* Skip checking: KASAN might save ...
2e7c954c11af96aa1e0566a706f22152ef91d759
Analyze and fix the following issue in the Linux kernel code: kasan: add return value for kasan_mempool_poison_object
Problem Details: Add a return value for kasan_mempool_poison_object that lets the caller know whether the allocation is affected by a double-free or an invalid-free bug. The caller can use this return value to stop operating on the object. Also introduce a check_page_allocation helper function to improve the code rea...
```diff diff --git a/include/linux/kasan.h b/include/linux/kasan.h index bbf6e2fa4ffd..33387e254caa 100644 --- a/include/linux/kasan.h +++ b/include/linux/kasan.h @@ -212,7 +212,7 @@ static __always_inline void * __must_check kasan_krealloc(const void *object, return (void *)object; } -void __kasan_mempool_poison_...
d1adb25df7111de83b64655a80b5a135adbded61
Analyze and fix the following issue in the Linux kernel code: mm: migrate: fix getting incorrect page mapping during page migration
Problem Details: When running stress-ng testing, we found below kernel crash after a few hours: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 pc : dentry_name+0xd8/0x224 lr : pointer+0x22c/0x370 sp : ffff800025f134c0 ...... Call trace: dentry_name+0xd8/0x224 pointer+0x22c/0x3...
```diff diff --git a/mm/migrate.c b/mm/migrate.c index 397f2a6e34cb..bad3039d165e 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1025,38 +1025,31 @@ out: } /* - * To record some information during migration, we use some unused - * fields (mapping and private) of struct folio of the newly allocated - * destination...
a4575c4138db887bd27dc7f87cf7cfb0224c6f5e
Analyze and fix the following issue in the Linux kernel code: mm: convert swap_cluster_readahead and swap_vma_readahead to return a folio
Problem Details: shmem_swapin_cluster() immediately converts the page back to a folio, and swapin_readahead() may as well call folio_file_page() once instead of having each function call it. [willy@infradead.org: avoid NULL pointer deref] Link: https://lkml.kernel.org/r/ZYI7OcVlM1voKfBl@casper.infradead.org Link: ht...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index c62f904ba1ca..a4d388973021 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1570,15 +1570,13 @@ static struct folio *shmem_swapin_cluster(swp_entry_t swap, gfp_t gfp, { struct mempolicy *mpol; pgoff_t ilx; - struct page *page; + struct folio *folio; mpol = shmem_g...
96db66d9c8f3c1547325af01b1f328b85d6ee1b9
Analyze and fix the following issue in the Linux kernel code: mm: convert ksm_might_need_to_copy() to work on folios
Problem Details: Patch series "Finish two folio conversions". Most callers of page_add_new_anon_rmap() and lru_cache_add_inactive_or_unevictable() have been converted to their folio equivalents, but there are still a few stragglers. There's a bit of preparatory work in ksm and unuse_pte(), but after that it's pretty ...
```diff diff --git a/include/linux/ksm.h b/include/linux/ksm.h index 4643d5244e77..401348e9f92b 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h @@ -76,7 +76,7 @@ static inline void ksm_exit(struct mm_struct *mm) * We'd like to make this conditional on vma->vm_flags & VM_MERGEABLE, * but what if the vma w...
1c8d39fa7b63dcbb77af7b0325fdc519c35fe618
Analyze and fix the following issue in the Linux kernel code: selftests/mm: call uffd_test_ctx_clear at the end of the test
Problem Details: uffd_test_ctx_clear() is being called from uffd_test_ctx_init() to unmap areas used in the previous test run. This approach is problematic because while unmapping areas uffd_test_ctx_clear() uses page_size and nr_pages which might differ from one test run to another. Fix this by calling uffd_test_ctx...
```diff diff --git a/tools/testing/selftests/mm/uffd-common.c b/tools/testing/selftests/mm/uffd-common.c index 02b89860e193..583e5a4cc0fd 100644 --- a/tools/testing/selftests/mm/uffd-common.c +++ b/tools/testing/selftests/mm/uffd-common.c @@ -262,7 +262,7 @@ static inline void munmap_area(void **area) *area = NULL; ...
fa399c3112344fa420944e99cd529d679411ebe6
Analyze and fix the following issue in the Linux kernel code: buffer: fix more functions for block size > PAGE_SIZE
Problem Details: Both __block_write_full_folio() and block_read_full_folio() assumed that block size <= PAGE_SIZE. Replace the shift with a divide, which is probably cheaper than first calculating the shift. That lets us remove block_size_bits() as these were the last callers. Link: https://lkml.kernel.org/r/2023110...
```diff diff --git a/fs/buffer.c b/fs/buffer.c index 9f4784150194..3a8c8322ed28 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1742,19 +1742,6 @@ unlock_page: } EXPORT_SYMBOL(clean_bdev_aliases); -/* - * Size is a power-of-two in the range 512..PAGE_SIZE, - * and the case we care about most is PAGE_SIZE. - * - * So...