Skip to content

block/partitions/of: Fix of_node reference leak in of_partition()#1002

Open
blktests-ci[bot] wants to merge 18 commits into
for-next_basefrom
series/1116407=>for-next
Open

block/partitions/of: Fix of_node reference leak in of_partition()#1002
blktests-ci[bot] wants to merge 18 commits into
for-next_basefrom
series/1116407=>for-next

Conversation

@blktests-ci

@blktests-ci blktests-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown

Pull request for series with
subject: block/partitions/of: Fix of_node reference leak in of_partition()
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1116407

axboe and others added 18 commits June 13, 2026 06:28
Pull in pending block changes, as the fuse zero-copy buffer changes
rely on both the block and io_uring trees.

* for-7.2/block: (114 commits)
  block: add configurable error injection
  block: add a str_to_blk_op helper
  block: add a "tag" for block status codes
  block: add a macro to initialize the status table
  floppy: Drop unused pnp driver data
  block: propagate in_flight to whole disk on partition I/O
  virtio-blk: clamp zone report to the report buffer capacity
  block: optimize I/O merge hot path with unlikely() hints
  drivers/block/rbd: Use strscpy() to copy strings into arrays
  partitions: aix: bound the pp_count scan to the ppe array
  block: Enable lock context analysis
  block/mq-deadline: Make the lock context annotations compatible with Clang
  block/Kyber: Make the lock context annotations compatible with Clang
  block/blk-mq-debugfs: Improve lock context annotations
  block/blk-iocost: Inline iocg_lock() and iocg_unlock()
  block/blk-iocost: Split ioc_rqos_throttle()
  block/crypto: Annotate the crypto functions
  block/cgroup: Inline blkg_conf_{open,close}_bdev_frozen()
  block/blk-iocost: Combine two error paths in ioc_qos_write()
  block/cgroup: Improve lock context annotations
  ...
…bvec()

Currently, io_buffer_register_bvec() takes in a request. In preparation
for supporting kernel-populated buffers in fuse io-uring (which will
need to register bvecs directly, not through a struct request), rename
this to io_buffer_register_request().

A subsequent patch will commandeer the "io_buffer_register_bvec()"
function name to support registering bvecs directly.

Rename io_buffer_unregister_bvec() to a more generic name,
io_buffer_unregister(), as both io_buffer_register_request() and
io_buffer_register_bvec() callers will use it for unregistration.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Link: https://patch.msgid.link/20260612184840.4058966-2-joannelkoong@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Split the main initialization logic in io_buffer_register_request() into
a helper function.

This is a preparatory patch for supporting kernel-populated buffers in
fuse io-uring, which will be reusing this logic.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Link: https://patch.msgid.link/20260612184840.4058966-3-joannelkoong@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Add io_buffer_register_bvec() for registering a bvec array.

This is a preparatory patch for fuse-over-io-uring zero-copy.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Link: https://patch.msgid.link/20260612184840.4058966-4-joannelkoong@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Rename IO_IMU_DEST and IO_IMU_SOURCE to IO_BUF_DEST and IO_BUF_SOURCE
and export it so subsystems may use it.

This is needed by the io_buffer_register_bvec() path for callers who may
need the buffer to be both readable and writable.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Link: https://patch.msgid.link/20260612184840.4058966-5-joannelkoong@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
* for-7.2/io_uring-epoll:
  io_uring/epoll: disallow adding an epoll file to an epoll context
  io_uring/epoll: switch to using do_epoll_ctl_file() interface
* for-7.2/io_uring-fuse:
  io_uring/rsrc: rename and export IO_IMU_DEST / IO_IMU_SOURCE
  io_uring/rsrc: add io_buffer_register_bvec()
  io_uring/rsrc: split io_buffer_register_request() logic
  io_uring/rsrc: rename io_buffer_register_bvec()/io_buffer_unregister_bvec()
* io_uring-7.2:
  io_uring, audit: don't log IORING_OP_RECV_ZC
  io_uring: get rid of tw_pending for !DEFER task work
  io_uring/rw: preserve partial result for iopoll
  io_uring/nop: fix file reference leak with IOSQE_FIXED_FILE
* block-7.2: (35 commits)
  block: fix IORING_URING_CMD_REISSUE flags check in blkdev_uring_cmd
  tracing/eprobes: Allow use of BTF names to dereference pointers
  tracing: Replace BUG_ON with lockdep_assert_held in uprobe_buffer functions
  tracing: Use flexible array for entry fetch code
  tracing/probes: Ensure the uprobe buffer size is bigger than event size
  tracing/osnoise: Array printk init and cleanup
  rtla: Document tests in README
  Documentation/rtla: Add -A/--aligned option
  rtla/tests: Add unit tests for -A/--aligned option
  rtla/timerlat: Add -A/--aligned CLI option
  rtla/tests: Add unit tests for CLI option callbacks
  rtla/tests: Add unit tests for _parse_args() functions
  rtla: Parse cmdline using libsubcmd
  tools subcmd: allow parsing distinct --opt and --no-opt
  tools subcmd: support optarg as separate argument
  rtla: Add libsubcmd dependency
  rtla/tests: Add runtime tests for restoring continue flag
  rtla/tests: Run runtime tests in temporary directory
  rtla/tests: Add unit test for restoring continue flag
  rtla/actions: Restore continue flag in actions_perform()
  ...
* block-7.2:
  block: Remove redundant plug in __submit_bio()
* io_uring-7.2:
  io_uring/register: preserve SQ array entries on resize
* block-7.2:
  block: invalidate cached plug timestamp after task switch
  kernel/fork: clear PF_BLOCK_TS in copy_process()
* block-7.2:
  block: respect iov_iter::nofault flag in bio_iov_iter_bounce_write()
  block: revert the iov_iter after a short copy in bio_iov_iter_bounce_write()
* io_uring-7.2:
  io_uring: Use system_dfl_wq instead of system_unbound_wq
* io_uring-7.2:
  io_uring/memmap: bound io_pin_pages() by page array byte size
* block-7.2:
  blk-cgroup: defer blkcg css_put until blkg is unlinked from queue
  blk-cgroup: fix UAF in __blkcg_rstat_flush()
  block, bfq: protect async queue reset with blkcg locks
  nbd: don't warn when reclassifying a busy socket lock
  block: fix incorrect error injection static key decrement
* block-7.2:
  nvmet-tcp: handle TCP_CLOSING state in nvmet_tcp_state_change
  nvmet-auth: reject short AUTH_RECEIVE buffers
  nvme-fc: Do not cancel requests in io target before it is initialized
  nvme: make nvme_add_ns{_head}_cdev return void
  nvme: make some sysfs diagnostic structures static
  nvmet-rdma: handle inline data with a nonzero offset
  nvme: target: allocate ana_state with port
  nvme: fix crash and memory leak during invalid cdev teardown
  nvmet: fix refcount leak in nvmet_sq_create()
  nvme: quieten sparse warning in valid LBA size check
  nvme-apple: Prevent shared tags across queues on Apple A11
@blktests-ci

blktests-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown
Author

Upstream branch: b9e3062
series: https://patchwork.kernel.org/project/linux-block/list/?series=1116407
version: 1

Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/linux-block/list/?series=1116407
error message:

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Applying: block/partitions/of: Fix of_node reference leak in of_partition()
Using index info to reconstruct a base tree...
M	block/partitions/of.c
Falling back to patching base and 3-way merge...
Auto-merging block/partitions/of.c
CONFLICT (content): Merge conflict in block/partitions/of.c
Patch failed at 0001 block/partitions/of: Fix of_node reference leak in of_partition()
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".'
  stderr: 'error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch'

conflict:

diff --cc block/partitions/of.c
index 53664ea06b65,e0a60c2191bc..000000000000
--- a/block/partitions/of.c
+++ b/block/partitions/of.c
@@@ -73,10 -73,11 +73,18 @@@ int of_partition(struct parsed_partitio
  
  	struct device_node *partitions_np = of_node_get(ddev->of_node);
  
++<<<<<<< HEAD
 +	if (!partitions_np ||
 +	    !of_device_is_compatible(partitions_np, "fixed-partitions")) {
 +		of_node_put(partitions_np);
 +		return 0;
++=======
+ 	if (!partitions_np)
+ 		return 0;
+ 	if (!of_device_is_compatible(partitions_np, "fixed-partitions")) {
+ 		of_node_put(partitions_np);
+ 		return 0;
++>>>>>>> block/partitions/of: Fix of_node reference leak in of_partition()
  	}
  
  	slot = 1;
@@@ -107,5 -108,6 +115,9 @@@
  	seq_buf_puts(&state->pp_buf, "\n");
  
  	of_node_put(partitions_np);
++<<<<<<< HEAD
++=======
+ 
++>>>>>>> block/partitions/of: Fix of_node reference leak in of_partition()
  	return 1;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants