id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
85ef671f9727aac580924cc1ce1ca0892524beee
Analyze and fix the following issue in the Linux kernel code: iommu: make inclusion of amd directory conditional
Problem Details: Nothing in there is active if CONFIG_AMD_IOMMU is not enabled, so the whole directory can depend on that switch as well. Fixes: cbe94c6e1a7d ("iommu/amd: Move Kconfig and Makefile bits down into amd directory") Signed-off-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.co...
```diff diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile index 53f800075398..a486032d3e07 100644 --- a/drivers/iommu/Makefile +++ b/drivers/iommu/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -obj-y += amd/ arm/ iommufd/ riscv/ +obj-y += arm/ iommufd/ riscv/ +obj-$(CONFIG_AMD_IOMMU) += amd/ ...
ddcc66cfe83ad0d6ec7cc5f94084767772fe5c9e
Analyze and fix the following issue in the Linux kernel code: iommu: make inclusion of intel directory conditional
Problem Details: Nothing in there is active if CONFIG_INTEL_IOMMU is not enabled, so the whole directory can depend on that switch as well. Fixes: ab65ba57e3ac ("iommu/vt-d: Move Kconfig and Makefile bits down into intel directory") Signed-off-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Lu Baolu <baolu.lu@linux.int...
```diff diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile index fe91d770abe1..53f800075398 100644 --- a/drivers/iommu/Makefile +++ b/drivers/iommu/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -obj-y += amd/ intel/ arm/ iommufd/ riscv/ +obj-y += amd/ arm/ iommufd/ riscv/ +obj-$(CONFIG_INTEL_IO...
9548feff840a05d61783e6316d08ed37e115f3b1
Analyze and fix the following issue in the Linux kernel code: iommu: remove duplicate selection of DMAR_TABLE
Problem Details: This is already done in intel/Kconfig. Fixes: 70bad345e622 ("iommu: Fix compilation without CONFIG_IOMMU_INTEL") Signed-off-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Link: https://lore.kernel.org/r/2232605.Mh6RI2rZIc@devpool92.emlix.com Signed-off-by: Joerg Roe...
```diff diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 9c3c210c82a2..0a33d995d15d 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -200,7 +200,6 @@ source "drivers/iommu/riscv/Kconfig" config IRQ_REMAP bool "Support for Interrupt Remapping" depends on X86_64 && X86_IO_APIC && PCI...
04cfc1ae14f3e95cd5a72aceab42b1387442f495
Analyze and fix the following issue in the Linux kernel code: iommu/fsl_pamu: remove trailing space after \n
Problem Details: There is an extraenous space after \n in a pr_debug message. Remove it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20250430151853.923614-1-colin.i.king@gmail.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
```diff diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index 30be786bff11..5f08523f97cb 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -64,7 +64,7 @@ static int update_liodn_stash(int liodn, struct fsl_dma_domain *dma_domain, spin_lock_irqsave(&io...
a26fd92b7223160ad31c3e2971b63178faed9cf5
Analyze and fix the following issue in the Linux kernel code: udmabuf: fix vmap missed offset page
Problem Details: Before invoke vmap, we need offer a pages pointer array which each page need to map in vmalloc area. But currently vmap_udmabuf only set each folio's head page into pages, missed each offset pages when iter. This patch set the correctly offset page in each folio into array. Signed-off-by: Huan Yang ...
```diff diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 79845565089d..af5200e360a6 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -120,7 +120,8 @@ static int vmap_udmabuf(struct dma_buf *buf, struct iosys_map *map) return -ENOMEM; for (pg = 0; pg < ubuf->pageco...
ceb7b62eaaaacfcf87473bd2e99ac73a758620cb
Analyze and fix the following issue in the Linux kernel code: Revert "udmabuf: fix vmap_udmabuf error page set"
Problem Details: This reverts commit 18d7de823b7150344d242c3677e65d68c5271b04. We cannot use vmap_pfn() in vmap_udmabuf() as it would fail the pfn_valid() check in vmap_pfn_apply(). This is because vmap_pfn() is intended to be used for mapping non-struct-page memory such as PCIe BARs. Since, udmabuf mostly works with ...
```diff diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig index fee04fdb0822..b46eb8a552d7 100644 --- a/drivers/dma-buf/Kconfig +++ b/drivers/dma-buf/Kconfig @@ -36,7 +36,6 @@ config UDMABUF depends on DMA_SHARED_BUFFER depends on MEMFD_CREATE || COMPILE_TEST depends on MMU - select VMAP_PFN help ...
08effa6b77f7dbb4727f811daef0f6085c0d63c8
Analyze and fix the following issue in the Linux kernel code: docs: ipmi: fix spelling and grammar mistakes
Problem Details: Corrected various spelling and grammatical mistakes in Documentation/driver-api/ipmi.rst to improve readability. No changes to the technical content has been made. Signed-off-by: Praveen Balakrishnan <praveen.balakrishnan@magd.ox.ac.uk> Message-ID: <20250515234757.19710-1-praveen.balakrishnan@magd.ox...
```diff diff --git a/Documentation/driver-api/ipmi.rst b/Documentation/driver-api/ipmi.rst index 3a533cd2ef60..2cc6c898ab90 100644 --- a/Documentation/driver-api/ipmi.rst +++ b/Documentation/driver-api/ipmi.rst @@ -45,7 +45,7 @@ manual), choose the 'IPMI SI handler' option. A driver also exists for direct I2C access ...
3cc35394fac15d533639c9c9e42f28d28936a4a0
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: fix firmware scan delay unit for WiFi 6 chips
Problem Details: The scan delay unit of firmware command for WiFi 6 chips is microsecond, but is wrong set now and lead to abnormal work for net-detect. Correct the unit to avoid the error. Fixes: e99dd80c8a18 ("wifi: rtw89: wow: add delay option for net-detect") Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 1abf69818fc6..00b65b2995cf 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -5537,7 +5537,7 @@ int rtw89_fw_h2c_scan_list_offload_be(struct rtw89_dev *rtwdev,...
4c2c372de2e108319236203cce6de44d70ae15cd
Analyze and fix the following issue in the Linux kernel code: wifi: rtw88: fix the 'para' buffer size to avoid reading out of bounds
Problem Details: Set the size to 6 instead of 2, since 'para' array is passed to 'rtw_fw_bt_wifi_control(rtwdev, para[0], &para[1])', which reads 5 bytes: void rtw_fw_bt_wifi_control(struct rtw_dev *rtwdev, u8 op_code, u8 *data) { ... SET_BT_WIFI_CONTROL_DATA1(h2c_pkt, *data); SET_BT_WIFI_CONTROL_DATA2(h2c...
```diff diff --git a/drivers/net/wireless/realtek/rtw88/coex.c b/drivers/net/wireless/realtek/rtw88/coex.c index c929db1e53ca..64904278ddad 100644 --- a/drivers/net/wireless/realtek/rtw88/coex.c +++ b/drivers/net/wireless/realtek/rtw88/coex.c @@ -309,7 +309,7 @@ static void rtw_coex_tdma_timer_base(struct rtw_dev *rtwd...
f24d0d8c3cd7e4237f802c4d2f3bd4ac04572948
Analyze and fix the following issue in the Linux kernel code: wifi: rtw88: Fix the random "error beacon valid" messages for USB
Problem Details: All the USB devices have a problem in AP mode: uploading the updated beacon to the chip's reserved page can randomly fail: [34996.474304] rtw88_8723du 1-2:1.2: error beacon valid [34996.474788] rtw88_8723du 1-2:1.2: failed to download drv rsvd page [34999.956369] rtw88_8723du 1-2:1.2: error beacon val...
```diff diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c index 6b563ac489a7..4fc78b882080 100644 --- a/drivers/net/wireless/realtek/rtw88/fw.c +++ b/drivers/net/wireless/realtek/rtw88/fw.c @@ -1466,7 +1466,7 @@ void rtw_add_rsvd_page_sta(struct rtw_dev *rtwdev, int rtw_fw_...
490340faddea461319652ce36dbc7c1b4482c35e
Analyze and fix the following issue in the Linux kernel code: wifi: rtw88: usb: Reduce control message timeout to 500 ms
Problem Details: RTL8811AU stops responding during the firmware download on some systems: [ 809.256440] rtw_8821au 5-2.1:1.0: Firmware version 42.4.0, H2C version 0 [ 812.759142] rtw_8821au 5-2.1:1.0 wlp48s0f4u2u1: renamed from wlan0 [ 837.315388] rtw_8821au 1-4:1.0: write register 0x1ef4 failed with -110 [ 867.52...
```diff diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c index 204343ac2558..b16db579fdce 100644 --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c @@ -139,7 +139,7 @@ static void rtw_usb_write(struct rtw_dev *rtwdev, u32 addr, u...
dda27a47c036d981ec664ac57e044a21035ffe12
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: pci: enlarge retry times of RX tag to 1000
Problem Details: RX tag is sequence number to ensure RX DMA is complete. On platform Gigabyte X870 AORUS ELITE WIFI7, sometimes it needs longer retry times to complete RX DMA, or driver throws warnings and connection drops: rtw89_8922ae 0000:07:00.0: failed to update 162 RXBD info: -11 rtw89_8922ae 0000:07:00.0: f...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c index b5cdc18f802a..064f6a940107 100644 --- a/drivers/net/wireless/realtek/rtw89/pci.c +++ b/drivers/net/wireless/realtek/rtw89/pci.c @@ -228,7 +228,7 @@ int rtw89_pci_sync_skb_for_device_and_validate_rx_info(struct...
a70cf04b08f44f41bce14659aa7012674b15d9de
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: pci: configure manual DAC mode via PCI config API only
Problem Details: To support 36-bit DMA, configure chip proprietary bit via PCI config API or chip DBI interface. However, the PCI device mmap isn't set yet and the DBI is also inaccessible via mmap, so only if the bit can be accessible via PCI config API, chip can support 36-bit DMA. Otherwise, fallback to 32-bit DMA. ...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c index c2fe5a898dc7..b5cdc18f802a 100644 --- a/drivers/net/wireless/realtek/rtw89/pci.c +++ b/drivers/net/wireless/realtek/rtw89/pci.c @@ -3105,17 +3105,26 @@ static bool rtw89_pci_is_dac_compatible_bridge(struct rtw...
7ee4fa04a8a27c7790a8fcd3093de3eb51aebb95
Analyze and fix the following issue in the Linux kernel code: cdrom: Remove unnecessary NULL check before unregister_sysctl_table()
Problem Details: unregister_sysctl_table() checks for NULL pointers internally. Remove unneeded NULL check here. Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Link: https://lore.kernel.org/lkml/20250514032139.2317578-1-nichen@iscas.ac.cn Reviewed-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/l...
```diff diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index b163e043c687..21a10552da61 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -3677,8 +3677,7 @@ static void cdrom_sysctl_register(void) static void cdrom_sysctl_unregister(void) { - if (cdrom_sysctl_header) - unregister_sysctl...
1a58791292ebb58cde3c0c708e41bb063b9dec6f
Analyze and fix the following issue in the Linux kernel code: sunrpc: Remove backchannel check in svc_init_buffer()
Problem Details: The server's backchannel uses struct svc_rqst, but does not use the pages in svc_rqst::rq_pages. It's rq_arg::pages and rq_res::pages comes from the RPC client's page allocator. Currently, svc_init_buffer() skips allocating pages in rq_pages for that reason. Except that, svc_rqst::rq_pages is filled a...
```diff diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index e7f9c295d13c..8ce3e6b3df6a 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -640,10 +640,6 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size, int node) { unsigned long pages, ret; - /* bc_xprt uses fore channel allocated buffers */ - ...
59243315890578a040a2d50ae9e001a2ef2fcb62
Analyze and fix the following issue in the Linux kernel code: svcrdma: Reduce the number of rdma_rw contexts per-QP
Problem Details: There is an upper bound on the number of rdma_rw contexts that can be created per QP. This invisible upper bound is because rdma_create_qp() adds one or more additional SQEs for each ctxt that the ULP requests via qp_attr.cap.max_rdma_ctxs. The QP's actual Send Queue length is on the order of the sum ...
```diff diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 5940a56023d1..3d7f1413df02 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -406,12 +406,12 @@ static void svc_rdma_xprt_done(struct rpcrdma_notification ...
16b7e65d299d56442879405ac85800877fa51355
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc: Track FAST_REQ H2Gs to report where errors came from
Problem Details: Most H2G messages are FAST_REQ which means no synchronous response is expected. The messages are sent as fire-and-forget with no tracking. However, errors can still be returned when something goes unexpectedly wrong. That leads to confusion due to not being able to match up the error response to the or...
```diff diff --git a/drivers/gpu/drm/xe/Kconfig.debug b/drivers/gpu/drm/xe/Kconfig.debug index db063a513b1e..01735c6ece8b 100644 --- a/drivers/gpu/drm/xe/Kconfig.debug +++ b/drivers/gpu/drm/xe/Kconfig.debug @@ -90,10 +90,13 @@ config DRM_XE_DEBUG_GUC bool "Enable extra GuC related debug options" depen...
d7d97890e2a7e3e306494dcbfb0e468a5089380d
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc: Rename CONFIG_XE_LARGE_GUC_BUFFER
Problem Details: Rename XE_LARGE_GUC_BUFFER to XE_DEBUG_GUC to allow for more debug only code (in subsequent patch) without adding more config defines that each control only a single thing. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Link: https:/...
```diff diff --git a/drivers/gpu/drm/xe/Kconfig.debug b/drivers/gpu/drm/xe/Kconfig.debug index 0d749ed44878..db063a513b1e 100644 --- a/drivers/gpu/drm/xe/Kconfig.debug +++ b/drivers/gpu/drm/xe/Kconfig.debug @@ -86,12 +86,14 @@ config DRM_XE_KUNIT_TEST If in doubt, say "N". -config DRM_XE_LARGE_GUC_BUFFER - ...
fddf8cdd4b9b7373f32f77e7a89123394e630188
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc: Remove double blank line
Problem Details: An earlier patch moved a drm_print a few lines lower but accidentally left a double blank line behind. So fix that. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Link: https://lore.kernel.org/r/20250512215324.1457009-2-John.C.Harris...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c index ff6edf1b14f4..b09dd5788a27 100644 --- a/drivers/gpu/drm/xe/xe_guc_ct.c +++ b/drivers/gpu/drm/xe/xe_guc_ct.c @@ -2013,7 +2013,6 @@ static void ct_dead_print(struct xe_dead_ct *dead) return; } - /* Can't generate a genuine...
46f7676c81533545f7e8e82e58880603f984cf0f
Analyze and fix the following issue in the Linux kernel code: Revert "remoteproc: core: Clear table_sz when rproc_shutdown"
Problem Details: Clearing the table_sz on cleanup seemed reasonable, but further discussions concluded that this merely working around the issue and that the fix is incomplete. As such, revert commit efdde3d73ab2 ("remoteproc: core: Clear table_sz when rproc_shutdown") to avoid carrying a partial fix. Signed-off-by: ...
```diff diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 48d146e1fa56..81b2ccf988e8 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2025,7 +2025,6 @@ int rproc_shutdown(struct rproc *rproc) kfree(rproc->cached_table); rpr...
8eb7ad66badc71e0d8547cf6195a2a6190090152
Analyze and fix the following issue in the Linux kernel code: x86/resctrl: Check all domains are offline in resctrl_exit()
Problem Details: resctrl_exit() removes things like the resctrl mount point directory and unregisters the filesystem prior to freeing data structures that were allocated during resctrl_init(). This assumes that there are no online domains when resctrl_exit() is called. If any domain were online, the limbo or overflow ...
```diff diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 88197afbbb8a..29f76ad21f1c 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -4420,8 +4420,41 @@ cleanup_mountpoint: return ret; } +static bool __exit resctrl...
276c53c66e032c8e7cc0da63555f2742eb1afd69
Analyze and fix the following issue in the Linux kernel code: gpu: drm: nova: select AUXILIARY_BUS instead of depending on it
Problem Details: CONFIG_AUXILIARY_BUS cannot be enabled explicitly, and unless we select it we have no way to include it (and thus to enable NOVA_DRM) unless another driver happens to do it for us. Fixes: cdeaeb9dd762 ("drm: nova-drm: add initial driver skeleton") Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>...
```diff diff --git a/drivers/gpu/drm/nova/Kconfig b/drivers/gpu/drm/nova/Kconfig index 123e96788484..cca6a3fea879 100644 --- a/drivers/gpu/drm/nova/Kconfig +++ b/drivers/gpu/drm/nova/Kconfig @@ -1,9 +1,9 @@ config DRM_NOVA tristate "Nova DRM driver" - depends on AUXILIARY_BUS depends on DRM=y depends on PCI de...
a6fdda6dfeb0b900979b3aac3a661ecec9e67711
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: select AUXILIARY_BUS instead of depending on it
Problem Details: CONFIG_AUXILIARY_BUS cannot be enabled explicitly, and unless we select it we have no way to include it (and thus to enable NOVA_CORE) unless another driver happens to do it for us. Fixes: e041d81a0377 ("gpu: nova-core: register auxiliary device for nova-drm") Signed-off-by: Alexandre Courbot <acourbo...
```diff diff --git a/drivers/gpu/nova-core/Kconfig b/drivers/gpu/nova-core/Kconfig index 67f99b6a023a..8726d80d6ba4 100644 --- a/drivers/gpu/nova-core/Kconfig +++ b/drivers/gpu/nova-core/Kconfig @@ -1,9 +1,9 @@ config NOVA_CORE tristate "Nova Core GPU driver" - depends on AUXILIARY_BUS depends on PCI depends on ...
80a8bcc65290bc95c11accd875fb3dd19fc7287e
Analyze and fix the following issue in the Linux kernel code: samples: rust: select AUXILIARY_BUS instead of depending on it
Problem Details: CONFIG_AUXILIARY_BUS cannot be enabled explicitly, and unless we select it we have no way to include it (and thus to enable the auxiliary driver sample) unless a driver happens to do it for us. Fixes: 96609a1969f4 ("samples: rust: add Rust auxiliary driver sample") Reviewed-by: Greg Kroah-Hartman <gre...
```diff diff --git a/samples/rust/Kconfig b/samples/rust/Kconfig index 43cb72d72631..b1006ab4bc3c 100644 --- a/samples/rust/Kconfig +++ b/samples/rust/Kconfig @@ -84,8 +84,8 @@ config SAMPLE_RUST_DRIVER_FAUX config SAMPLE_RUST_DRIVER_AUXILIARY tristate "Auxiliary Driver" - depends on AUXILIARY_BUS depends on PCI...
cd171461b90a2d2cf230943df60d580174633718
Analyze and fix the following issue in the Linux kernel code: tcp: fix initial tp->rcvq_space.space value for passive TS enabled flows
Problem Details: tcp_rcv_state_process() must tweak tp->advmss for TS enabled flows before the call to tcp_init_transfer() / tcp_init_buffer_space(). Otherwise tp->rcvq_space.space is off by 120 bytes (TCP_INIT_CWND * TCPOLEN_TSTAMP_ALIGNED). Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Wei Wang <we...
```diff diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index f3eae8f5ad2b..32b8b332c7d8 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -6872,6 +6872,9 @@ tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) if (!tp->srtt_us) tcp_synack_rtt_meas(sk, req); + if (tp->rx_opt.tsta...
ea33537d82921e71f852ea2ed985acc562125efe
Analyze and fix the following issue in the Linux kernel code: tcp: add receive queue awareness in tcp_rcv_space_adjust()
Problem Details: If the application can not drain fast enough a TCP socket queue, tcp_rcv_space_adjust() can overestimate tp->rcvq_space.space. Then sk->sk_rcvbuf can grow and hit tcp_rmem[2] for no good reason. Fix this by taking into acount the number of available bytes. Keeping sk->sk_rcvbuf at the right size all...
```diff diff --git a/include/linux/tcp.h b/include/linux/tcp.h index a8af71623ba7..29f59d50dc73 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -340,7 +340,7 @@ struct tcp_sock { } rcv_rtt_est; /* Receiver queue space */ struct { - u32 space; + int space; u32 seq; u64 time; } rcvq_space; di...
65c5287892e9a881e41758cbf071df6ec9c24a76
Analyze and fix the following issue in the Linux kernel code: tcp: fix sk_rcvbuf overshoot
Problem Details: Current autosizing in tcp_rcv_space_adjust() is too aggressive. Instead of betting on possible losses and over estimate BDP, it is better to only account for slow start. The following patch is then adding a more precise tuning in the events of packet losses. Signed-off-by: Eric Dumazet <edumazet@goo...
```diff diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 88beb6d0f7b5..89e886bb0fa1 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -747,6 +747,29 @@ static inline void tcp_rcv_rtt_measure_ts(struct sock *sk, } } +static void tcp_rcvbuf_grow(struct sock *sk) +{ + const struct net *net...
532b9e11b8540eb543ebec9cba851c5691e10b5b
Analyze and fix the following issue in the Linux kernel code: block: fix elv_update_nr_hw_queues() to reattach elevator
Problem Details: When nr_hw_queues is updated, the elevator needs to be switched to ensure that we exit elevator and reattach it to ensure that hctx-> sched_tags is correctly allocated for the new hardware queues. However, elv_update_nr_hw_queues() currently only switches the elevator if the queue is not registered. Th...
```diff diff --git a/block/elevator.c b/block/elevator.c index f8d72bd20610..ab22542e6cf0 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -697,7 +697,7 @@ void elv_update_nr_hw_queues(struct request_queue *q) WARN_ON_ONCE(q->mq_freeze_depth == 0); mutex_lock(&q->elevator_lock); - if (q->elevator && !blk_q...
4bcb0c7dc25446b99fc7a8fa2a143d69f3314162
Analyze and fix the following issue in the Linux kernel code: Bluetooth: btusb: use skb_pull to avoid unsafe access in QCA dump handling
Problem Details: Use skb_pull() and skb_pull_data() to safely parse QCA dump packets. This avoids direct pointer math on skb->data, which could lead to invalid access if the packet is shorter than expected. Fixes: 20981ce2d5a5 ("Bluetooth: btusb: Add WCN6855 devcoredump support") Signed-off-by: En-Wei Wu <en-wei.wu@c...
```diff diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index a42dedb78e0a..256b451bbe06 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -3014,9 +3014,8 @@ static void btusb_coredump_qca(struct hci_dev *hdev) static int handle_dump_pkt_qca(struct hci_dev *hdev, struct sk_bu...
7af8479d9eb4319b4ba7b47a8c4d2c55af1c31e1
Analyze and fix the following issue in the Linux kernel code: Bluetooth: L2CAP: Fix not checking l2cap_chan security level
Problem Details: l2cap_check_enc_key_size shall check the security level of the l2cap_chan rather than the hci_conn since for incoming connection request that may be different as hci_conn may already been encrypted using a different security level. Fixes: 522e9ed157e3 ("Bluetooth: l2cap: Check encryption key size on i...
```diff diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 73472756618a..042d3ac3b4a3 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -1411,7 +1411,8 @@ static void l2cap_request_info(struct l2cap_conn *conn) sizeof(req), &req); } -static bool l2cap_check...
dd24f87f65c957f30e605e44961d2fd53a44c780
Analyze and fix the following issue in the Linux kernel code: ublk: fix dead loop when canceling io command
Problem Details: Commit: f40139fde527 ("ublk: fix race between io_uring_cmd_complete_in_task and ublk_cancel_cmd") adds a request state check in ublk_cancel_cmd(), and if the request is started, skips canceling this uring_cmd. However, the current uring_cmd may be in ACTIVE state, without block request coming to t...
```diff diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index f9032076bc06..dc104c025cd5 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -1708,7 +1708,7 @@ static void ublk_cancel_cmd(struct ublk_queue *ubq, unsigned tag, * that ublk_dispatch_req() is always called */ re...
17a85f520469a1838379de8ad24f63e778f7c277
Analyze and fix the following issue in the Linux kernel code: btrfs: fix wrong start offset for delalloc space release during mmap write
Problem Details: If we're doing a mmap write against a folio that has i_size somewhere in the middle and we have multiple sectors in the folio, we may have to release excess space previously reserved, for the range going from the rounded up (to sector size) i_size to the folio's end offset. We are calculating the right...
```diff diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 660a73b6af90..32aad1b02b01 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1918,7 +1918,7 @@ again: if (reserved_space < fsize) { end = page_start + reserved_space - 1; btrfs_delalloc_release_space(BTRFS_I(inode), - data_reserved, page_s...
9c78317b42e7c32523c91099859bc4721e9f75dd
Analyze and fix the following issue in the Linux kernel code: iio: accel: fxls8962af: Fix temperature scan element sign
Problem Details: Mark the temperature element signed, data read from the TEMP_OUT register is in two's complement format. This will avoid the temperature being mishandled and miss displayed. Fixes: a3e0b51884ee ("iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers") Suggested-by: Marcelo Schmitt <marcelo....
```diff diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c index 5f5e917f7aa5..ae965a8f560d 100644 --- a/drivers/iio/accel/fxls8962af-core.c +++ b/drivers/iio/accel/fxls8962af-core.c @@ -749,6 +749,7 @@ static const struct iio_event_spec fxls8962af_event[] = { BIT(IIO_CHAN_...
16038474e3a0263572f36326ef85057aaf341814
Analyze and fix the following issue in the Linux kernel code: iio: accel: fxls8962af: Fix temperature calculation
Problem Details: According to spec temperature should be returned in milli degrees Celsius. Add in_temp_scale to calculate from Celsius to milli Celsius. Fixes: a3e0b51884ee ("iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers") Cc: stable@vger.kernel.org Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gm...
```diff diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c index bf1d3923a181..5f5e917f7aa5 100644 --- a/drivers/iio/accel/fxls8962af-core.c +++ b/drivers/iio/accel/fxls8962af-core.c @@ -23,6 +23,7 @@ #include <linux/regulator/consumer.h> #include <linux/regmap.h> #include <linux/...
99bcd91fabada0dbb1d5f0de44532d8008db93c6
Analyze and fix the following issue in the Linux kernel code: perf/x86/intel: Fix segfault with PEBS-via-PT with sample_freq
Problem Details: Currently, using PEBS-via-PT with a sample frequency instead of a sample period, causes a segfault. For example: BUG: kernel NULL pointer dereference, address: 0000000000000195 <NMI> ? __die_body.cold+0x19/0x27 ? page_fault_oops+0xca/0x290 ? exc_page_fault+0x7e/0x1b0 ? asm_exc...
```diff diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c index 9b20acc0e932..8d86e91bd5e5 100644 --- a/arch/x86/events/intel/ds.c +++ b/arch/x86/events/intel/ds.c @@ -2465,8 +2465,9 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs, struct perf_sample_ setup_pebs_fixed_sample_data)...
7cdfbc0113d087348b8e65dd79276d0f57b89a10
Analyze and fix the following issue in the Linux kernel code: iio: adc: ad7944: mask high bits on direct read
Problem Details: Apply a mask to the raw value received over the SPI bus for unsigned direct reads. As we found recently, SPI controllers may not set unused bits to 0 when reading with bits_per_word != {8,16,32}. The ad7944 uses bits_per_word of 14 and 18, so we need to mask the value to be sure we returning the correc...
```diff diff --git a/drivers/iio/adc/ad7944.c b/drivers/iio/adc/ad7944.c index 2f949fe55873..37a137bd8357 100644 --- a/drivers/iio/adc/ad7944.c +++ b/drivers/iio/adc/ad7944.c @@ -377,6 +377,8 @@ static int ad7944_single_conversion(struct ad7944_adc *adc, if (chan->scan_type.sign == 's') *val = sign_extend32(*val...
0afc44d8cdf6029cce0a92873f0de5ac9416cec8
Analyze and fix the following issue in the Linux kernel code: net: devmem: fix kernel panic when netlink socket close after module unload
Problem Details: Kernel panic occurs when a devmem TCP socket is closed after NIC module is unloaded. This is Devmem TCP unregistration scenarios. number is an order. (a)netlink socket close (b)pp destroy (c)uninstall result 1 2 3 OK 1 ...
```diff diff --git a/net/core/devmem.c b/net/core/devmem.c index 6e27a47d0493..2db428ab6b8b 100644 --- a/net/core/devmem.c +++ b/net/core/devmem.c @@ -200,6 +200,8 @@ net_devmem_bind_dmabuf(struct net_device *dev, unsigned int dmabuf_fd, refcount_set(&binding->ref, 1); + mutex_init(&binding->lock); + binding->d...
1adf711919de7c9e1b281a4d9cd9e3a81f3a70f7
Analyze and fix the following issue in the Linux kernel code: x86/mm: Fix kernel-doc descriptions of various pgtable methods
Problem Details: So 'make W=1' complains about a couple of kernel-doc descriptions in our MM primitives in pgtable.c: arch/x86/mm/pgtable.c:623: warning: Function parameter or struct member 'reserve' not described in 'reserve_top_address' arch/x86/mm/pgtable.c:672: warning: Function parameter or struct member 'p4d...
```diff diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 7c253deb46e9..59c42dec7076 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c @@ -543,11 +543,11 @@ pud_t pudp_invalidate(struct vm_area_struct *vma, unsigned long address, #endif /** - * reserve_top_address - reserves a hole in th...
b3ca9eef6646576ad506a96d941d87a69f66732a
Analyze and fix the following issue in the Linux kernel code: tsnep: fix timestamping with a stacked DSA driver
Problem Details: This driver is susceptible to a form of the bug explained in commit c26a2c2ddc01 ("gianfar: Fix TX timestamping with a stacked DSA driver") and in Documentation/networking/timestamping.rst section "Other caveats for MAC drivers", specifically it timestamps any skb which has SKBTX_HW_TSTAMP, and does no...
```diff diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c index 625245b0845c..eba73246f986 100644 --- a/drivers/net/ethernet/engleder/tsnep_main.c +++ b/drivers/net/ethernet/engleder/tsnep_main.c @@ -67,6 +67,8 @@ #define TSNEP_TX_TYPE_XDP_NDO_MAP_PAGE (TSNEP_TX_TYPE_...
d6e020819612a4a06207af858e0978be4d3e3140
Analyze and fix the following issue in the Linux kernel code: drm/i915/gem: Allow EXEC_CAPTURE on recoverable contexts on DG1
Problem Details: The intel-media-driver is currently broken on DG1 because it uses EXEC_CAPTURE with recovarable contexts. Relax the check to allow that. I've also submitted a fix for the intel-media-driver: https://github.com/intel/media-driver/pull/1920 Cc: stable@vger.kernel.org # v6.0+ Cc: Matthew Auld <matthew.a...
```diff diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c index 02c59808cbe4..7d44aadcd5a5 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -2013,7 +2013,7 @@ static int eb_capture_stage(struct ...
788019eb559fd0b365f501467ceafce540e377cc
Analyze and fix the following issue in the Linux kernel code: genirq: Retain disable depth for managed interrupts across CPU hotplug
Problem Details: Affinity-managed interrupts can be shut down and restarted during CPU hotunplug/plug. Thereby the interrupt may be left in an unexpected state. Specifically: 1. Interrupt is affine to CPU N 2. disable_irq() -> depth is 1 3. CPU N goes offline 4. irq_shutdown() -> depth is set to 1 (again) 5. CPU ...
```diff diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 1d45c84d7356..b0e0a7332993 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -202,6 +202,19 @@ __irq_startup_managed(struct irq_desc *desc, const struct cpumask *aff, return IRQ_STARTUP_ABORT; return IRQ_STARTUP_MANAGED; } + +void irq_startu...
491deb9b8c4ad12fe51d554a69b8165b9ef9429f
Analyze and fix the following issue in the Linux kernel code: net/tls: fix kernel panic when alloc_page failed
Problem Details: We cannot set frag_list to NULL pointer when alloc_page failed. It will be used in tls_strp_check_queue_ok when the next time tls_strp_read_sock is called. This is because we don't reset full_len in tls_strp_flush_anchor_copy() so the recv path will try to continue handling the partial record on the n...
```diff diff --git a/net/tls/tls_strp.c b/net/tls/tls_strp.c index 77e33e1e340e..65b0da6fdf6a 100644 --- a/net/tls/tls_strp.c +++ b/net/tls/tls_strp.c @@ -396,7 +396,6 @@ static int tls_strp_read_copy(struct tls_strparser *strp, bool qshort) return 0; shinfo = skb_shinfo(strp->anchor); - shinfo->frag_list = NULL...
a4a39c81e1043b153bde3ef5cb3cf94222ffd918
Analyze and fix the following issue in the Linux kernel code: genirq: Bump the size of the local variable for sprintf()
Problem Details: GCC is not happy about a sprintf() call on a buffer that might be too small for the given formatting string. kernel/irq/debugfs.c:233:26: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=] Fix this by bumping the size of the local variable for sprintf(...
```diff diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c index 3d6a5b3cfaf3..3527defd2890 100644 --- a/kernel/irq/debugfs.c +++ b/kernel/irq/debugfs.c @@ -225,7 +225,7 @@ void irq_debugfs_copy_devname(int irq, struct device *dev) void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc) { - char n...
325eb217e41fa14f307c7cc702bd18d0bb38fe84
Analyze and fix the following issue in the Linux kernel code: bnxt_en: bring back rtnl_lock() in the bnxt_open() path
Problem Details: Error recovery, PCIe AER, resume, and TX timeout will invoke bnxt_open() with netdev_lock only. This will cause RTNL assert failure in netif_set_real_num_tx_queues(), netif_set_real_num_tx_queues(), and netif_set_real_num_tx_queues(). Example error recovery assert: RTNL: assertion failed at net/core...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 86a5de44b6f3..6afc2ab6fad2 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -14013,13 +14013,28 @@ static void bnxt_unlock_sp(struct bnxt *bp) netde...
92ec4855034b2c4d13f117558dc73d20581fa9ff
Analyze and fix the following issue in the Linux kernel code: mlxsw: spectrum_router: Fix use-after-free when deleting GRE net devices
Problem Details: The driver only offloads neighbors that are constructed on top of net devices registered by it or their uppers (which are all Ethernet). The device supports GRE encapsulation and decapsulation of forwarded traffic, but the driver will not offload dummy neighbors constructed on top of GRE net devices as...
```diff diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 464821dd492d..a2033837182e 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -3014,6 +3014,9 @@ static ...
08fb624802d8786253994d8ebdbbcdaa186f04f5
Analyze and fix the following issue in the Linux kernel code: irqchip/riscv-imsic: Start local sync timer on correct CPU
Problem Details: When starting the local sync timer to synchronize the state of a remote CPU it should be added on the CPU to be synchronized, not the initiating CPU. This results in interrupt delivery being delayed until the timer eventually runs (due to another mask/unmask/migrate operation) on the target CPU. Fixes...
```diff diff --git a/drivers/irqchip/irq-riscv-imsic-state.c b/drivers/irqchip/irq-riscv-imsic-state.c index bdf5cd2037f2..62f76950a113 100644 --- a/drivers/irqchip/irq-riscv-imsic-state.c +++ b/drivers/irqchip/irq-riscv-imsic-state.c @@ -208,17 +208,17 @@ skip: } #ifdef CONFIG_SMP -static void __imsic_local_timer_...
dbc5ba08ec5ff799a32f27ac79702a2cfc2200cd
Analyze and fix the following issue in the Linux kernel code: block/blk-throttle: silence !BLK_DEV_IO_TRACE variable warnings
Problem Details: If blk-throttle is enabled but blktrace is not, then the compiler will notice that the following two variables are unused: ../block/blk-throttle.c: In function 'throtl_pending_timer_fn': ../block/blk-throttle.c:1153:30: warning: unused variable 'bio_cnt_w' [-Wunused-variable] 1153 | u...
```diff diff --git a/block/blk-throttle.c b/block/blk-throttle.c index bf4faac83662..bd15357f23bd 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -1149,8 +1149,8 @@ again: dispatched = false; while (true) { - unsigned int bio_cnt_r = sq_queued(sq, READ); - unsigned int bio_cnt_w = sq_queued(sq, ...
3be5fa236649da6404f1bca1491bf02d4b0d5cce
Analyze and fix the following issue in the Linux kernel code: Revert "iommu/amd: Prevent binding other PCI drivers to IOMMU PCI devices"
Problem Details: Commit 991de2e59090 ("PCI, x86: Implement pcibios_alloc_irq() and pcibios_free_irq()") changed IRQ handling on PCI driver probing. It inadvertently broke resume from system sleep on AMD platforms: https://lore.kernel.org/r/20150926164651.GA3640@pd.tnic/ This was fixed by two independent commits: *...
```diff diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index dd9e26b7b718..33b6e12c7d24 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -2030,9 +2030,6 @@ static int __init iommu_init_pci(struct amd_iommu *iommu) if (!iommu->dev) return -ENODEV; - /* Prevent binding othe...
eaa287069a70aa80e5e95d5162445962809d8158
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc_submit: Simplify and fix diff calculation
Problem Details: With a u32 type, there's no need to check which one is greater: the current is always the latest and if it's less than the previous, it's because it wrapped: just do the unsigned calculation that will lead to the same result, or better the correct one. It fixes an off-by-one in the wrapped calculation,...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index fb125f940de8..80f748baad3f 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -976,10 +976,7 @@ static bool check_timeout(struct xe_exec_queue *q, struct xe_sched_job *job) */ ...
276036283716b9135525b195675ea42801bde204
Analyze and fix the following issue in the Linux kernel code: clk: rockchip: rk3528: add slab.h header include
Problem Details: The newly added GRF types introduced kzalloc usage into the rk3528. At least for the similar rk3576 driver, the kernel-test-robot reported the missing prototype, which warranted adding a slab.h include. While it did not complain about the rk3528, so the header might be included "accidentially" right n...
```diff diff --git a/drivers/clk/rockchip/clk-rk3528.c b/drivers/clk/rockchip/clk-rk3528.c index f5f10493abfb..a5ff64b93f8f 100644 --- a/drivers/clk/rockchip/clk-rk3528.c +++ b/drivers/clk/rockchip/clk-rk3528.c @@ -12,6 +12,7 @@ #include <linux/platform_device.h> #include <linux/mfd/syscon.h> #include <linux/minmax....
92da5c3cba23ee4be2c043bb63a551c89c48de18
Analyze and fix the following issue in the Linux kernel code: clk: rockchip: rk3576: add missing slab.h include
Problem Details: The change for auxiliary GRFs introduced kzalloc usage into the rk3576 clock driver, but missed adding the header for its prototype. Add it now. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202505150941.KWKskr2c-lkp@intel.com/ Fixes: 70a114daf207 ("clk: ...
```diff diff --git a/drivers/clk/rockchip/clk-rk3576.c b/drivers/clk/rockchip/clk-rk3576.c index 71e77013f726..1f4547af5acf 100644 --- a/drivers/clk/rockchip/clk-rk3576.c +++ b/drivers/clk/rockchip/clk-rk3576.c @@ -10,6 +10,7 @@ #include <linux/platform_device.h> #include <linux/syscore_ops.h> #include <linux/mfd/sy...
febd8c6ab52c683b447fe22fc740918c86feae43
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma with Haikou
Problem Details: The u2phy0_host port is the part of the USB PHY0 (namely the HOST0_DP/DM lanes) which routes directly to the USB2.0 HOST controller[1]. The other lanes of the PHY are routed to the USB3.0 OTG controller (dwc3), which we do use. The HOST0_DP/DM lanes aren't routed on RK3399 Puma so let's simply disable...
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts index f2234dabd664..70979079923c 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts @@ -312,14 +312,6 @@ status = "okay...
3373af1d76bacd054b37f3e10266dd335ce425f8
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma
Problem Details: The u2phy1_host port is the part of the USB PHY1 (namely the HOST1_DP/DM lanes) which routes directly to the USB2.0 HOST controller[1]. The other lanes of the PHY are routed to the USB3.0 OTG controller (dwc3), which we do use. The HOST1_DP/DM lanes aren't routed on RK3399 Puma so let's simply disable...
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi index 314d9dfdba57..587e89d7fc5e 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi @@ -585,10 +585,6 @@ u2phy1_otg: otg-port { status = "ok...
d7cc532df95f7f159e40595440e4e4b99481457b
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: fix internal USB hub instability on RK3399 Puma
Problem Details: Currently, the onboard Cypress CYUSB3304 USB hub is not defined in the device tree, and hub reset pin is provided as vcc5v0_host regulator to usb phy. This causes instability issues, as a result of improper reset duration. The fixed regulator device requests the GPIO during probe in its inactive state...
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi index e00fbaa8acc1..314d9dfdba57 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi @@ -60,16 +60,6 @@ vin-supply = <&vcc5v0_sys>; }; - vc...
1ad4b5a7de16806afc1aeaf012337e62af04e001
Analyze and fix the following issue in the Linux kernel code: dt-bindings: usb: cypress,hx3: Add support for all variants
Problem Details: The Cypress HX3 hubs use different default PID value depending on the variant. Update compatibles list. Becasuse all hub variants use the same driver data, allow the dt node to have two compatibles: leftmost which matches the HW exactly, and the second one as fallback. Fixes: 1eca51f58a10 ("dt-binding...
```diff diff --git a/Documentation/devicetree/bindings/usb/cypress,hx3.yaml b/Documentation/devicetree/bindings/usb/cypress,hx3.yaml index 1033b7a4b8f9..d6eac1213228 100644 --- a/Documentation/devicetree/bindings/usb/cypress,hx3.yaml +++ b/Documentation/devicetree/bindings/usb/cypress,hx3.yaml @@ -14,9 +14,22 @@ allOf:...
daf004f87c3520c414992893e2eadd5db5f86a5a
Analyze and fix the following issue in the Linux kernel code: clk: meson-g12a: add missing fclk_div2 to spicc
Problem Details: SPICC is missing fclk_div2, which means fclk_div5 and fclk_div7 indexes are wrong on this clock. This causes the spicc module to output sclk at 2.5x the expected rate when clock index 3 is picked. Adding the missing fclk_div2 resolves this. [jbrunet: amended commit description] Fixes: a18c8e0b7697 ("...
```diff diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c index ceabebb1863d..d9e546e006d7 100644 --- a/drivers/clk/meson/g12a.c +++ b/drivers/clk/meson/g12a.c @@ -4093,6 +4093,7 @@ static const struct clk_parent_data spicc_sclk_parent_data[] = { { .hw = &g12a_clk81.hw }, { .hw = &g12a_fclk_div4.hw }...
7dbfa4266c5e1e72db274bcb60d17691bbea513e
Analyze and fix the following issue in the Linux kernel code: btrfs: fix harmless race getting delayed ref head count when running delayed refs
Problem Details: When running delayed references we are reading the number of ready delayed ref heads without taking any lock which can make KCSAN report a race since we can have concurrent tasks updating that number, such as for example when freeing a tree block which will end up decrementing that counter or when addi...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 1aa584a79422..cb6128778a83 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -2006,7 +2006,12 @@ static noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, delayed_refs = &trans->transaction->delayed_ref...
d3914d6030aa6be2993dfc223d096ff93018c236
Analyze and fix the following issue in the Linux kernel code: btrfs: fix invalid data space release when truncating block in NOCOW mode
Problem Details: If when truncating a block we fail to reserve data space and then we proceed anyway because we can do a NOCOW write, if we later get an error when trying to get the folio from the inode's mapping, we end up releasing data space that we haven't reserved, screwing up the bytes_may_use counter from the da...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 964088d3f3f7..b189371c142f 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4931,8 +4931,11 @@ again: folio = __filemap_get_folio(mapping, index, FGP_LOCK | FGP_ACCESSED | FGP_CREAT, mask); if (IS_ERR(folio)) { - btrfs_delalloc_release...
585e944a31e3e87bc17169a9b519093e77bfdd61
Analyze and fix the following issue in the Linux kernel code: btrfs: send: remove btrfs_debug() calls
Problem Details: There are debugging prints for each emitted send command and other related actions. This does not seem right as the number of commands can be high and dumping that to the system log will likely hit some rate limiting. This should be done by trace points that are more lightweight and can keep up with h...
```diff diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 36ad01e34577..2891ec4056c6 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -816,11 +816,8 @@ static int send_cmd(struct send_ctx *sctx) static int send_rename(struct send_ctx *sctx, struct fs_path *from, struct fs_path *to) { - struct btrfs_fs...
08c649a5637371cb6bf8f3e974323cf59a7f434b
Analyze and fix the following issue in the Linux kernel code: btrfs: check we grabbed inode reference when allocating an ordered extent
Problem Details: When allocating an ordered extent we call igrab() to get a reference on the inode and attach it to the ordered extent. For an ordered extent we always must have an inode reference since we during its life cycle we need to access the inode for several things like for example: * Inserting the ordered ex...
```diff diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index e44d3dd17caf..a6c5fc78bc4f 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -172,11 +172,8 @@ static struct btrfs_ordered_extent *alloc_ordered_extent( } entry = kmem_cache_zalloc(btrfs_ordered_extent_cache, GFP_NOFS);...
1f2889f5594a2bc4c6a52634c4a51b93e785def5
Analyze and fix the following issue in the Linux kernel code: btrfs: fix qgroup reservation leak on failure to allocate ordered extent
Problem Details: If we fail to allocate an ordered extent for a COW write we end up leaking a qgroup data reservation since we called btrfs_qgroup_release_data() but we didn't call btrfs_qgroup_free_refroot() (which would happen when running the respective data delayed ref created by ordered extent completion or when f...
```diff diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index ae49f87b27e8..e44d3dd17caf 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -153,9 +153,10 @@ static struct btrfs_ordered_extent *alloc_ordered_extent( struct btrfs_ordered_extent *entry; int ret; u64 qgroup_rsv = 0;...
4e2945f73b076bbd5c0bbb8f0da1e52180de9bda
Analyze and fix the following issue in the Linux kernel code: btrfs: handle aligned EOF truncation correctly for subpage cases
Problem Details: [BUG] For the following fsx -e 1 run, the btrfs still fails the run on 64K page size with 4K fs block size: READ BAD DATA: offset = 0x26b3a, size = 0xfafa, fname = /mnt/btrfs/junk OFFSET GOOD BAD RANGE 0x26b3a 0x0000 0x15b4 0x0 operation# (mod 256) for the bad data may be 21 ...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index db46fda53770..9dfa9f421306 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4785,6 +4785,52 @@ static bool is_inside_block(u64 bytenr, u64 blockstart, u32 blocksize) return false; } +static int truncate_block_zero_beyond_eof(struct btrfs_inode ...
8e4f21f2b13d6cc29b59ad7faaac7aafbf3569e3
Analyze and fix the following issue in the Linux kernel code: btrfs: handle unaligned EOF truncation correctly for subpage cases
Problem Details: [BUG] The following fsx sequence will fail on btrfs with 64K page size and 4K fs block size: #fsx -d -e 1 -N 4 $mnt/junk -S 36386 READ BAD DATA: offset = 0xe9ba, size = 0x6dd5, fname = /mnt/btrfs/junk OFFSET GOOD BAD RANGE 0xe9ba 0x0000 0x03ac 0x0 operation# (mod 256) for ...
```diff diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index a5ebd2b9e242..a79fa0726f1d 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -547,8 +547,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, struct btrfs_inode *parent_inode, struct btrfs_inode *inode, const s...
3649833a58b6cae14651900629e74e9a710e0fb6
Analyze and fix the following issue in the Linux kernel code: btrfs: fix broken drop_caches on extent buffer folios
Problem Details: The (correct) commit e41c81d0d30e ("mm/truncate: Replace page_mapped() call in invalidate_inode_page()") replaced the page_mapped(page) check with a refcount check. However, this refcount check does not work as expected with drop_caches for btrfs's metadata pages. Btrfs has a per-sb metadata inode wit...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 8467b0128c93..e43f6280f954 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2747,6 +2747,7 @@ static bool folio_range_has_eb(struct folio *folio) static void detach_extent_buffer_folio(const struct extent_buffer *eb, struct folio *f...
f2c19541e421b3235efc515dad88b581f00592ae
Analyze and fix the following issue in the Linux kernel code: btrfs: scrub: fix a wrong error type when metadata bytenr mismatches
Problem Details: When the bytenr doesn't match for a metadata tree block, we will report it as an csum error, which is incorrect and should be reported as a metadata error instead. Fixes: a3ddbaebc7c9 ("btrfs: scrub: introduce a helper to verify one metadata block") Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by:...
```diff diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 7da3745b5a8e..907f44d7698a 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -611,7 +611,7 @@ static void scrub_verify_one_metadata(struct scrub_stripe *stripe, int sector_nr memcpy(on_disk_csum, header->csum, fs_info->csum_size); if (logical !=...
ec1f3a207cdf314eae4d4ae145f1ffdb829f0652
Analyze and fix the following issue in the Linux kernel code: btrfs: scrub: update device stats when an error is detected
Problem Details: [BUG] Since the migration to the new scrub_stripe interface, scrub no longer updates the device stats when hitting an error, no matter if it's a read or checksum mismatch error. E.g: BTRFS info (device dm-2): scrub: started on devid 1 BTRFS error (device dm-2): unable to fixup (regular) error at l...
```diff diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 5d6166fd917e..bf503419e0e9 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -153,12 +153,14 @@ struct scrub_stripe { unsigned int init_nr_io_errors; unsigned int init_nr_csum_errors; unsigned int init_nr_meta_errors; + unsigned int init_nr_meta...
b2460c2aee9a757bf0b438dde5b5ee71afc54e44
Analyze and fix the following issue in the Linux kernel code: btrfs: remove unnecessary NULL checks before freeing extent state
Problem Details: When manipulating extent bits for an io tree range, we have this pattern: if (prealloc) btrfs_free_extent_state(prealloc); but this is not needed nowadays since btrfs_free_extent_state() ignores a NULL pointer argument, following the common pattern of kernel and btrfs freeing functions, ...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index dd36322fbf6b..9266bb39c619 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -761,8 +761,7 @@ search_again: out: spin_unlock(&tree->lock); - if (prealloc) - btrfs_free_extent_state(prealloc); + btrfs_free_exte...
41d69d4d78d8b179bf3bcdfc56d28a12b3a608d2
Analyze and fix the following issue in the Linux kernel code: btrfs: exit after state split error at set_extent_bit()
Problem Details: If split_state() returned an error we call extent_io_tree_panic() which will trigger a BUG() call. However if CONFIG_BUG is disabled, which is an uncommon and exotic scenario, then we fallthrough and hit a use after free when calling set_state_bits() since the extent state record which the local variab...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 29cf3a01294f..36bdf9df7b4c 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -1250,8 +1250,11 @@ hit_next: if (!prealloc) goto search_again; ret = split_state(tree, state, prealloc, end + 1); - if (ret) +...
67f10a10187b17ac62abddf66d16cec9d0f89a7c
Analyze and fix the following issue in the Linux kernel code: btrfs: exit after state insertion failure at set_extent_bit()
Problem Details: If insert_state() state failed it returns an error pointer and we call extent_io_tree_panic() which will trigger a BUG() call. However if CONFIG_BUG is disabled, which is an uncommon and exotic scenario, then we fallthrough and call cache_state() which will dereference the error pointer, resulting in a...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index bf2152ff8efa..29cf3a01294f 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -1223,6 +1223,7 @@ hit_next: if (IS_ERR(inserted_state)) { ret = PTR_ERR(inserted_state); extent_io_tree_panic(tree, prealloc, ...
3bf179e36da917c5d9bec71c714573ed1649b7c1
Analyze and fix the following issue in the Linux kernel code: btrfs: exit after state insertion failure at btrfs_convert_extent_bit()
Problem Details: If insert_state() state failed it returns an error pointer and we call extent_io_tree_panic() which will trigger a BUG() call. However if CONFIG_BUG is disabled, which is an uncommon and exotic scenario, then we fallthrough and call cache_state() which will dereference the error pointer, resulting in a...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 0b154f1a3546..0697afebb71d 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -1439,6 +1439,7 @@ hit_next: if (IS_ERR(inserted_state)) { ret = PTR_ERR(inserted_state); extent_io_tree_panic(tree, prealloc, ...
2a72dd999610f9a8e2ddc0eaaf054cd66e45cde7
Analyze and fix the following issue in the Linux kernel code: btrfs: exit after state split error at btrfs_convert_extent_bit()
Problem Details: If split_state() returned an error we call extent_io_tree_panic() which will trigger a BUG() call. However if CONFIG_BUG is disabled, which is an uncommon and exotic scenario, then we fallthrough and hit a use after free when calling set_state_bits() since the extent state record which the local variab...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 2c004e0c431d..0b154f1a3546 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -1460,8 +1460,11 @@ hit_next: } ret = split_state(tree, state, prealloc, end + 1); - if (ret) + if (ret) { extent_io_tree_pa...
5af1eae78d882efeaaa9a95e6ac7d70a8bf5fb9f
Analyze and fix the following issue in the Linux kernel code: btrfs: add missing error return to btrfs_clear_extent_bit_changeset()
Problem Details: We have a couple error branches where we have an error stored in the 'err' variable and then jump to the 'out' label, however we don't return that error, we just return 0. Normally this is not a problem since those error branches call extent_io_tree_panic() which triggers a BUG() call, however it's pos...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index b868313e777e..3743ff777ada 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -604,7 +604,7 @@ int btrfs_clear_extent_bit_changeset(struct extent_io_tree *tree, u64 start, u64 struct extent_state *cached; struct ...
2187540b6f4d92b4bf7622244dc2cbfa61ff1855
Analyze and fix the following issue in the Linux kernel code: btrfs: exit after state split error at btrfs_clear_extent_bit_changeset()
Problem Details: If split_state() returned an error we call extent_io_tree_panic() which will trigger a BUG() call. However if CONFIG_BUG is disabled, which is an uncommon and exotic scenario, then we fallthrough and hit a use after free when calling clear_state_bit() since the extent state record which the local varia...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 15400a0f899c..b868313e777e 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -712,8 +712,11 @@ hit_next: if (!prealloc) goto search_again; err = split_state(tree, state, prealloc, end + 1); - if (err) + ...
656e9f51de3a02eb708c384d4d0152cfb969ea8b
Analyze and fix the following issue in the Linux kernel code: btrfs: rename btrfs_discard workqueue to btrfs-discard
Problem Details: We use the "btrfs-" prefix for our workqueues, the discard has underscore instead of dash, so unify it. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 3d151d189510..1cdc1436fe4a 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1994,7 +1994,7 @@ static int btrfs_init_workqueues(struct btrfs_fs_info *fs_info) btrfs_alloc_ordered_workqueue(fs_info, "qgroup-rescan", ordered_flag...
13d6d866e8ca25555f0599fe9408cb86afda85f2
Analyze and fix the following issue in the Linux kernel code: btrfs: on unknown chunk allocation policy fallback to regular
Problem Details: We have only two chunk allocation policies right now and the switch/cases don't handle an unknown one properly. The error is in the impossible category (the policy is stored only in memory), we don't have to BUG(), falling back to regular policy should be safe. Signed-off-by: David Sterba <dsterba@sus...
```diff diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 85fa73b32eb0..12260592d37f 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1528,6 +1528,9 @@ static bool contains_pending_extent(struct btrfs_device *device, u64 *start, static u64 dev_extent_search_start(struct btrfs_device *device) { ...
73d6bcf41bd2e9906060bcc8b182cdb9775e61f9
Analyze and fix the following issue in the Linux kernel code: btrfs: subpage: reject tree blocks which are not nodesize aligned
Problem Details: When btrfs subpage support (fs block < page size) was introduced, a subpage filesystem will only reject tree blocks which cross page boundaries. This used to be a compromise to simplify the tree block handling and still allowing subpage cases to read some old converted filesystems which did not have p...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index a231d03d51c7..dc8db26c821c 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3068,10 +3068,9 @@ static bool check_eb_alignment(struct btrfs_fs_info *fs_info, u64 start) return true; } - if (fs_info->nodesize < PAGE_SIZE && - ...
9e0a739a9e83eb28ceb0b1e97861c88f177a7f18
Analyze and fix the following issue in the Linux kernel code: btrfs: convert ASSERT(0) with handled errors to DEBUG_WARN()
Problem Details: The use of ASSERT(0) is maybe useful for some cases but more like a notice for developers. Assertions can be compiled in independently so convert it to a debugging helper. The difference is that it's just a warning and will not end up in BUG(). The converted cases are in connection with proper error h...
```diff diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index e76e1845cfce..6ee0259048cd 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -3617,7 +3617,7 @@ int btrfs_backref_finish_upper_links(struct btrfs_backref_cache *cache, /* Sanity check, we shouldn't have any unchecked nodes */ if (!uppe...
ed50ab0fec1a881a379bea7187994ff6cbe2fc58
Analyze and fix the following issue in the Linux kernel code: btrfs: convert WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG)) to DEBUG_WARN
Problem Details: Use the conditional warning instead of typing the whole condition. Optional message is printed where it seems clear what could be the problem. Conversion is left out in btree_csum_one_bio() because of the additional condition. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterb...
```diff diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 5936cff80ff3..e76e1845cfce 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -2877,7 +2877,7 @@ int btrfs_backref_iter_start(struct btrfs_backref_iter *iter, u64 bytenr) goto release; } if (path->slots[0] == 0) { - WARN_ON(IS_ENABLED(C...
3db15c6ca6feb2c5000a1cbb39c33866e0349abd
Analyze and fix the following issue in the Linux kernel code: btrfs: add debug build only WARN
Problem Details: Add conditional WARN() wrapper that's enabled only in debug build. It should be used for unexpected conditions that should be noisy. Use it instead of ASSERT(0). As it will not lead to BUG() make sure that continuing is still possible, e.g. the error is handled anyway. Reviewed-by: Josef Bacik <josef...
```diff diff --git a/fs/btrfs/messages.h b/fs/btrfs/messages.h index d4e85485d824..6abf81bb00c2 100644 --- a/fs/btrfs/messages.h +++ b/fs/btrfs/messages.h @@ -243,6 +243,13 @@ do { \ #define ASSERT(cond, args...) (void)(cond) #endif +#ifdef CONFIG_BTRFS_DEBUG +/* Verbose warning only under debug build. *...
6f3f722df7254b7e652e042a93f7e2b011223af0
Analyze and fix the following issue in the Linux kernel code: btrfs: simplify bvec iteration in index_one_bio()
Problem Details: Flatten the two loops by open coding bio_for_each_segment() and advancing the iterator one sector at a time. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Qu Wenruo <wqu@suse.com> [ Fix a bug that @offset is not increased. ] Signed-off-by: Q...
```diff diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index bd6350e8f5c5..6e1d9cdd59c1 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1195,23 +1195,22 @@ static int rbio_add_io_sector(struct btrfs_raid_bio *rbio, static void index_one_bio(struct btrfs_raid_bio *rbio, struct bio *bio) { const u32 se...
ecf5b757c74cb8e487a4e7cf2e90b9a3103d764a
Analyze and fix the following issue in the Linux kernel code: btrfs: update and correct description of btrfs_get_or_create_delayed_node()
Problem Details: The comment mistakenly says the function is returning PTR_ERR instead of ERR_PTR. Fix it and update it so it's more descriptive. Signed-off-by: Charles Han <hanchunchao@inspur.com> Reviewed-by: David Sterba <dsterba@suse.com> [ Enhance the function comment. ] Signed-off-by: David Sterba <dsterba@suse....
```diff diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index c49bf8f2889d..2d62e9ba65a4 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -119,7 +119,12 @@ static struct btrfs_delayed_node *btrfs_get_delayed_node( return NULL; } -/* Will return either the node or PTR_ERR(-EN...
9a36bad6c394f23b5a8deecaca9e47acce6be8b7
Analyze and fix the following issue in the Linux kernel code: btrfs: rename __tree_search() to remove double underscore prefix
Problem Details: There's no need to have a double underscore prefix as there's no variant of the function without it. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
```diff diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 974163ed0c27..02bfdb976e40 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -136,8 +136,8 @@ static int tree_insert(struct rb_root *root, struct extent_map *em) * Search through the tree for an extent_map with a given offset. I...
7e8866903225fe7bc35d46614f11e5b90594abb8
Analyze and fix the following issue in the Linux kernel code: btrfs: rename __lookup_extent_mapping() to remove double underscore prefix
Problem Details: There's no need to have a double underscore prefix as there's no variant of the function without it anymore. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
```diff diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 042b8b2e8b52..974163ed0c27 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -508,9 +508,8 @@ static int add_extent_mapping(struct btrfs_inode *inode, return 0; } -static struct extent_map * -__lookup_extent_mapping(struct ext...
d846a6d3b09fa046e061ea6ec6daba67e66a7101
Analyze and fix the following issue in the Linux kernel code: btrfs: rename remaining exported extent map functions
Problem Details: Rename all the exported functions from extent_map.h that don't have a 'btrfs_' prefix in their names, so that they are consistent with all the other functions, to make it clear they are btrfs specific functions and to avoid potential name collisions in the future with functions defined elsewhere in the...
```diff diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 00cda793cec5..d0ed078e5334 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -501,7 +501,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, page_end = (pg_index << PAGE_SHIFT) + folio_size(folio) - 1; btrfs_lo...
2e871330cea44f7459726b0d83252949ae76166f
Analyze and fix the following issue in the Linux kernel code: btrfs: rename extent map functions to get block start, end and check if in tree
Problem Details: These functions are exported and don't have a 'btrfs_' prefix in their names, which goes against coding style conventions. Rename them to have such prefix, making it clear they are from btrfs and avoiding potential collisions in the future with functions defined elsewhere outside btrfs. Signed-off-by:...
```diff diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 28259e6b7358..fb112b2abc1d 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -510,8 +510,8 @@ static noinline int add_ra_bio_pages(struct inode *inode, * to this compressed extent on disk. */ if (!em || cur < em->sta...
962162ffa64f311a8c0cfbf1acfe7a8da126d4b0
Analyze and fix the following issue in the Linux kernel code: btrfs: rename exported extent map compression functions
Problem Details: These functions are exported and don't have a 'btrfs_' prefix in their names, which goes against coding style conventions. Rename them to have such prefix, making it clear they are from btrfs and avoiding potential collisions in the future with functions defined elsewhere outside btrfs. Signed-off-by:...
```diff diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 8f3771451faa..28259e6b7358 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -588,7 +588,7 @@ void btrfs_submit_compressed_read(struct btrfs_bio *bbio) goto out; } - ASSERT(extent_map_is_compressed(em)); + ASSERT(btrfs_e...
81eb6ce8b55a0f6757e9f87702bd6437ea834c65
Analyze and fix the following issue in the Linux kernel code: btrfs: tracepoints: add btrfs prefix to names where it's missing
Problem Details: Most of our tracepoints have the 'btrfs_' prefix in their names but a few of them are missing, making it inconsistent. So add the prefix to the ones that are missing it, creating consistency, making it clear for users these are btrfs tracepoints and eventually avoid name collisions with other tracepoin...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 266a159fe5bb..a68a8a07caff 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4376,7 +4376,7 @@ static noinline int find_free_extent(struct btrfs_root *root, ins->objectid = 0; ins->offset = 0; - trace_find_free_extent(ro...
00ba32e5be977fc156fa5a2e5bdf6d1f6570452f
Analyze and fix the following issue in the Linux kernel code: btrfs: remove double underscore prefix from __set_extent_bit()
Problem Details: Now that set_extent_bit() was renamed to btrfs_set_extent_bit(), there's no need to have a __set_extent_bit() function, we can just remove the double underscore prefix, which we try to avoid according to the coding style conventions. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 503bb387e7a2..11f2e195ef8d 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -1022,11 +1022,11 @@ out: * * [start, end] is inclusive This takes the tree lock. */ -static int __set_extent_bit(struct extent_io_t...
94bd699a08eda0607a651536c4ecbcad6c9fe5b3
Analyze and fix the following issue in the Linux kernel code: btrfs: rename remaining exported functions from extent-io-tree.h
Problem Details: Rename the remaning exported functions that don't have a 'btrfs_' prefix. By convention exported functions should have such prefix to make it clear they are btrfs specific and to avoid collisions with functions from elsewhere in the kernel. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> ...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 6317004f36c4..503bb387e7a2 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -1280,9 +1280,9 @@ int btrfs_set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, * * All allocations are done with GFP_NOF...
b351161f4f6643868c9803ba99e57b20a227cd9c
Analyze and fix the following issue in the Linux kernel code: btrfs: rename free_extent_state() to include a btrfs prefix
Problem Details: This is an exported function so it should have a 'btrfs_' prefix by convention, to make it clear it's btrfs specific and to avoid collisions with functions from elsewhere in the kernel. Rename the function to add 'btrfs_' prefix to it. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Sign...
```diff diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 55608ac8dbe0..483e71e09181 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c @@ -804,7 +804,7 @@ static int btrfs_set_target_alloc_state(struct btrfs_device *srcdev, start = found_end + 1; } - free_extent_state(cached_state...
f81c2aea711205c1a4f41e4aaf960053eddba0b9
Analyze and fix the following issue in the Linux kernel code: btrfs: rename the functions to count, test and get bit ranges in io trees
Problem Details: These functions are exported so they should have a 'btrfs_' prefix by convention, to make it clear they are btrfs specific and to avoid collisions with functions from elsewhere in the kernel. So add a 'btrfs_' prefix to their names to make it clear they are from btrfs. Reviewed-by: Johannes Thumshirn...
```diff diff --git a/fs/btrfs/defrag.c b/fs/btrfs/defrag.c index 587f2504a570..d56815a685be 100644 --- a/fs/btrfs/defrag.c +++ b/fs/btrfs/defrag.c @@ -1024,8 +1024,8 @@ static int defrag_collect_targets(struct btrfs_inode *inode, * very likely resulting in a larger extent after writeback is * triggered (e...
e965835c9829b1188879f75d678e19f7ec110ac6
Analyze and fix the following issue in the Linux kernel code: btrfs: rename the functions to init and release an extent io tree
Problem Details: These functions are exported so they should have a 'btrfs_' prefix by convention, to make it clear they are btrfs specific and to avoid collisions with functions from elsewhere in the kernel. So add a 'btrfs_' prefix to their name to make it clear they are from btrfs. Reviewed-by: Johannes Thumshirn ...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 2586dd05483a..1464e36eceac 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -691,10 +691,10 @@ static void __setup_root(struct btrfs_root *root, struct btrfs_fs_info *fs_info, btrfs_set_root_last_log_commit(root, 0); root->anon_dev = 0; ...
02c340c2781177242386ac5f31cc498a6929ed44
Analyze and fix the following issue in the Linux kernel code: btrfs: rename the functions to get inode and fs_info from an extent io tree
Problem Details: These functions are exported so they should have a 'btrfs_' prefix by convention, to make it clear they are btrfs specific and to avoid collisions with functions from elsewhere in the kernel. So add a 'btrfs_' prefix to their name to make it clear they are from btrfs. Also remove the 'const' suffix fr...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 245b78c65edd..abf0f83a15cb 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -65,7 +65,7 @@ static inline void __btrfs_debug_check_extent_io_range(const char *caller, if (tree->owner != IO_TREE_INODE_IO) return...
66da9c1bed97554f1b40c5086c7ade22292e5eca
Analyze and fix the following issue in the Linux kernel code: btrfs: rename the functions to search for bits in extent ranges
Problem Details: These functions are exported so they should have a 'btrfs_' prefix by convention, to make it clear they are btrfs specific and to avoid collisions with functions from elsewhere in the kernel. So add a 'btrfs_' prefix to their name to make it clear they are from btrfs. Reviewed-by: Johannes Thumshirn ...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 944c355bf051..91807d294366 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -525,9 +525,9 @@ int btrfs_add_new_free_space(struct btrfs_block_group *block_group, u64 start, *total_added_ret = 0; while (start < end) { - ...
791b3455aca10bc28e996c2ff81bc1e078248cf3
Analyze and fix the following issue in the Linux kernel code: btrfs: rename set_extent_bit() to include a btrfs prefix
Problem Details: This is an exported function so it should have a 'btrfs_' prefix by convention, to make it clear it's btrfs specific and to avoid collisions with functions from elsewhere in the kernel. So rename it to btrfs_set_extent_bit(). Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by:...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index a5c587cf42a7..944c355bf051 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -2216,9 +2216,9 @@ static int exclude_super_stripes(struct btrfs_block_group *cache) if (cache->start < BTRFS_SUPER_INFO_OFFSET) { stripe_len = B...
9d222562b415f19efd32d7a5290f40bb07feea3b
Analyze and fix the following issue in the Linux kernel code: btrfs: rename the functions to clear bits for an extent range
Problem Details: These functions are exported so they should have a 'btrfs_' prefix by convention, to make it clear they are btrfs specific and to avoid collisions with functions from elsewhere in the kernel. One of them has a double underscore prefix which is also discouraged. So remove double underscore prefix where...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 3eba00da9fc7..a5c587cf42a7 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -832,8 +832,8 @@ out: static inline void btrfs_free_excluded_extents(const struct btrfs_block_group *bg) { - clear_extent_bits(&bg->fs_info->exclu...
2cb9ac3faadc964f2640f55246c1f4f6c5ea76be
Analyze and fix the following issue in the Linux kernel code: btrfs: rename __lock_extent() and __try_lock_extent()
Problem Details: These functions are exported so they should have a 'btrfs_' prefix by convention, to make it clear they are btrfs specific and to avoid collisions with functions from elsewhere in the kernel. Their double underscore prefix is also discouraged. So remove their double underscore prefix, add a 'btrfs_' p...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 59448d3028d3..dad092a1f81c 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -1831,8 +1831,8 @@ int clear_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, return __clear_extent_bit(tree, start, ...
b696440e5e13490bbd23f7c4656a861db04d14d7
Analyze and fix the following issue in the Linux kernel code: btrfs: add btrfs prefix to dio lock and unlock extent functions
Problem Details: These functions are exported so they should have a 'btrfs_' prefix by convention, to make it clear they are btrfs specific and to avoid collisions with functions from elsewhere in the kernel. So add a prefix to their name. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Fil...
```diff diff --git a/fs/btrfs/direct-io.c b/fs/btrfs/direct-io.c index eef8f0a93e80..0b421a6a2182 100644 --- a/fs/btrfs/direct-io.c +++ b/fs/btrfs/direct-io.c @@ -42,10 +42,10 @@ static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend, /* Direct lock must be taken before the extent lock. */ ...
41708a4c23500ebd024d66adaafe0e6022df29a9
Analyze and fix the following issue in the Linux kernel code: btrfs: add btrfs prefix to trace events for extent state alloc and free
Problem Details: These trace events don't have the 'btrfs_' prefix in their name, unlike the other trace events from extent-io-tree.c. So add the prefix to make them consistent and follow coding style conventions too. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Filipe Manana <fdmanana@s...
```diff diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 40da61cf3f0e..59448d3028d3 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -159,7 +159,7 @@ static struct extent_state *alloc_extent_state(gfp_t mask) btrfs_leak_debug_add_state(state); refcount_set(&state->re...
2b14b74b992187933069cb3316c691dbd5707f47
Analyze and fix the following issue in the Linux kernel code: btrfs: use folio_contains() for EOF detection
Problem Details: Currently we use the following pattern to detect if the folio contains the end of a file: if (folio->index == end_index) folio_zero_range(); But that only works if the folio is page sized. For the following case, it will not work and leave the range beyond EOF uninitialized: The page size is 4...
```diff diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 56d970434b4b..74edd2dd92ff 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -523,7 +523,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, free_extent_map(em); unlock_extent(tree, cur, page_end, NULL); - i...