<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/rust/kernel/block, branch v6.16</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.16</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.16'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-05-11T22:20:25Z</updated>
<entry>
<title>rust: convert raw URLs to Markdown autolinks in comments</title>
<updated>2025-05-11T22:20:25Z</updated>
<author>
<name>Xizhe Yin</name>
<email>xizheyin@smail.nju.edu.cn</email>
</author>
<published>2025-04-07T03:34:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=86d990c7b699581918de2a379c6eebac7292940e'/>
<id>urn:sha1:86d990c7b699581918de2a379c6eebac7292940e</id>
<content type='text'>
Some comments in Rust files use raw URLs (http://example.com) rather
than Markdown autolinks &lt;URL&gt;. This inconsistency makes the
documentation less uniform and harder to maintain.

This patch converts all remaining raw URLs in Rust code comments to use
the Markdown autolink format, maintaining consistency with the rest of
the codebase which already uses this style.

Suggested-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Link: https://github.com/Rust-for-Linux/linux/issues/1153
Signed-off-by: Xizhe Yin &lt;xizheyin@smail.nju.edu.cn&gt;
Link: https://lore.kernel.org/r/509F0B66E3C1575D+20250407033441.5567-1-xizheyin@smail.nju.edu.cn
[ Used From form for Signed-off-by. Sorted tags. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: block: refactor to use `&amp;raw mut`</title>
<updated>2025-03-23T19:39:37Z</updated>
<author>
<name>Antonio Hickey</name>
<email>contact@antoniohickey.com</email>
</author>
<published>2025-03-20T02:07:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2a571248dfa9d1ebac9db4564472b3dec157c99f'/>
<id>urn:sha1:2a571248dfa9d1ebac9db4564472b3dec157c99f</id>
<content type='text'>
Replace all occurrences (one) of `addr_of_mut!(place)` with
`&amp;raw mut place`.

This will allow us to reduce macro complexity, and improve consistency
with existing reference syntax as `&amp;raw mut` is similar to `&amp;mut` making
it fit more naturally with other existing code.

Suggested-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Link: https://github.com/Rust-for-Linux/linux/issues/1148
Signed-off-by: Antonio Hickey &lt;contact@antoniohickey.com&gt;
Acked-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Link: https://lore.kernel.org/r/20250320020740.1631171-17-contact@antoniohickey.com
[ Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: make pin-init its own crate</title>
<updated>2025-03-16T20:59:19Z</updated>
<author>
<name>Benno Lossin</name>
<email>benno.lossin@proton.me</email>
</author>
<published>2025-03-08T11:05:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dbd5058ba60c3499b24a7133a4e2e24dba6ea77b'/>
<id>urn:sha1:dbd5058ba60c3499b24a7133a4e2e24dba6ea77b</id>
<content type='text'>
Rename relative paths inside of the crate to still refer to the same
items, also rename paths inside of the kernel crate and adjust the build
system to build the crate.

[ Remove the `expect` (and thus the `lint_reasons` feature) since
  the tree now uses `quote!` from `rust/macros/export.rs`. Remove the
  `TokenStream` import removal, since it is now used as well.

  In addition, temporarily (i.e. just for this commit) use an `--extern
  force:alloc` to prevent an unknown `new_uninit` error in the `rustdoc`
  target. For context, please see a similar case in:

      https://lore.kernel.org/lkml/20240422090644.525520-1-ojeda@kernel.org/

  And adjusted the message above. - Miguel ]

Signed-off-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Fiona Behrens &lt;me@kloenk.dev&gt;
Tested-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Link: https://lore.kernel.org/r/20250308110339.2997091-16-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'rust-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux</title>
<updated>2025-01-22T01:48:03Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-01-22T01:48:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e3610441d1fb47b1f00e4c38bdf333176e824729'/>
<id>urn:sha1:e3610441d1fb47b1f00e4c38bdf333176e824729</id>
<content type='text'>
Pull rust updates from Miguel Ojeda:
 "Toolchain and infrastructure:

   - Finish the move to custom FFI integer types started in the previous
     cycle and finally map 'long' to 'isize' and 'char' to 'u8'. Do a
     few cleanups on top thanks to that.

   - Start to use 'derive(CoercePointee)' on Rust &gt;= 1.84.0.

     This is a major milestone on the path to build the kernel using
     only stable Rust features. In particular, previously we were using
     the unstable features 'coerce_unsized', 'dispatch_from_dyn' and
     'unsize', and now we will use the new 'derive_coerce_pointee' one,
     which is on track to stabilization. This new feature is a macro
     that essentially expands into code that internally uses the
     unstable features that we were using before, without having to
     expose those.

     With it, stable Rust users, including the kernel, will be able to
     build custom smart pointers that work with trait objects, e.g.:

         fn f(p: &amp;Arc&lt;dyn Display&gt;) {
             pr_info!("{p}\n");
         }

         let a: Arc&lt;dyn Display&gt; = Arc::new(42i32, GFP_KERNEL)?;
         let b: Arc&lt;dyn Display&gt; = Arc::new("hello there", GFP_KERNEL)?;

         f(&amp;a); // Prints "42".
         f(&amp;b); // Prints "hello there".

     Together with the 'arbitrary_self_types' feature that we started
     using in the previous cycle, using our custom smart pointers like
     'Arc' will eventually only rely in stable Rust.

   - Introduce 'PROCMACROLDFLAGS' environment variable to allow to link
     Rust proc macros using different flags than those used for linking
     Rust host programs (e.g. when 'rustc' uses a different C library
     than the host programs' one), which Android needs.

   - Help kernel builds under macOS with Rust enabled by accomodating
     other naming conventions for dynamic libraries (i.e. '.so' vs.
     '.dylib') which are used for Rust procedural macros. The actual
     support for macOS (i.e. the rest of the pieces needed) is provided
     out-of-tree by others, following the policy used for other parts of
     the kernel by Kbuild.

   - Run Clippy for 'rusttest' code too and clean the bits it spotted.

   - Provide Clippy with the minimum supported Rust version to improve
     the suggestions it gives.

   - Document 'bindgen' 0.71.0 regression.

  'kernel' crate:

   - 'build_error!': move users of the hidden function to the documented
     macro, prevent such uses in the future by moving the function
     elsewhere and add the macro to the prelude.

   - 'types' module: add improved version of 'ForeignOwnable::borrow_mut'
     (which was removed in the past since it was problematic); change
     'ForeignOwnable' pointer type to '*mut'.

   - 'alloc' module: implement 'Display' for 'Box' and align the 'Debug'
     implementation to it; add example (doctest) for 'ArrayLayout::new()'

   - 'sync' module: document 'PhantomData' in 'Arc'; use
     'NonNull::new_unchecked' in 'ForeignOwnable for Arc' impl.

   - 'uaccess' module: accept 'Vec's with different allocators in
     'UserSliceReader::read_all'.

   - 'workqueue' module: enable run-testing a couple more doctests.

   - 'error' module: simplify 'from_errno()'.

   - 'block' module: fix formatting in code documentation (a lint to catch
     these is being implemented).

   - Avoid 'unwrap()'s in doctests, which also improves the examples by
     showing how kernel code is supposed to be written.

   - Avoid 'as' casts with 'cast{,_mut}' calls which are a bit safer.

  And a few other cleanups"

* tag 'rust-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux: (32 commits)
  kbuild: rust: add PROCMACROLDFLAGS
  rust: uaccess: generalize userSliceReader to support any Vec
  rust: kernel: add improved version of `ForeignOwnable::borrow_mut`
  rust: kernel: reorder `ForeignOwnable` items
  rust: kernel: change `ForeignOwnable` pointer to mut
  rust: arc: split unsafe block, add missing comment
  rust: types: avoid `as` casts
  rust: arc: use `NonNull::new_unchecked`
  rust: use derive(CoercePointee) on rustc &gt;= 1.84.0
  rust: alloc: add doctest for `ArrayLayout::new()`
  rust: init: update `stack_try_pin_init` examples
  rust: error: import `kernel`'s `LayoutError` instead of `core`'s
  rust: str: replace unwraps with question mark operators
  rust: page: remove unnecessary helper function from doctest
  rust: rbtree: remove unwrap in asserts
  rust: init: replace unwraps with question mark operators
  rust: use host dylib naming convention to support macOS
  rust: add `build_error!` to the prelude
  rust: kernel: move `build_error` hidden function to prevent mistakes
  rust: use the `build_error!` macro, not the hidden function
  ...
</content>
</entry>
<entry>
<title>rust: add `build_error!` to the prelude</title>
<updated>2025-01-09T23:19:09Z</updated>
<author>
<name>Miguel Ojeda</name>
<email>ojeda@kernel.org</email>
</author>
<published>2024-11-23T22:28:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4401565fe92be6ee54a68ea58d80a4076007d5eb'/>
<id>urn:sha1:4401565fe92be6ee54a68ea58d80a4076007d5eb</id>
<content type='text'>
The sibling `build_assert!` is already in the prelude, it makes sense
that a "core"/"language" facility like this is part of the prelude and
users should not be defining their own one (thus there should be no risk
of future name collisions and we would want to be aware of them anyway).

Thus add `build_error!` into the prelude.

Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Link: https://lore.kernel.org/r/20241123222849.350287-3-ojeda@kernel.org
[ Applied the change to the new miscdevice cases. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: use the `build_error!` macro, not the hidden function</title>
<updated>2025-01-09T23:19:05Z</updated>
<author>
<name>Miguel Ojeda</name>
<email>ojeda@kernel.org</email>
</author>
<published>2024-11-23T22:28:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=15f2f9313a394f97fb9443271721e9ff1c8d4be4'/>
<id>urn:sha1:15f2f9313a394f97fb9443271721e9ff1c8d4be4</id>
<content type='text'>
Code and some examples were using the function, rather than the macro. The
macro is what is documented.

Thus move users to the macro.

Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Link: https://lore.kernel.org/r/20241123222849.350287-1-ojeda@kernel.org
[ Applied the change to the new miscdevice cases. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: block: fix use of BLK_MQ_F_SHOULD_MERGE</title>
<updated>2024-12-23T15:17:23Z</updated>
<author>
<name>Andreas Hindborg</name>
<email>a.hindborg@kernel.org</email>
</author>
<published>2024-12-20T09:37:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=31d813a3b8cbde2d09ba4dee282ca29096541006'/>
<id>urn:sha1:31d813a3b8cbde2d09ba4dee282ca29096541006</id>
<content type='text'>
BLK_MQ_F_SHOULD_MERGE has was removed [1] and is now in effect by default.
So remove the flag from tag sets of Rust block device drivers.

Link: https://lore.kernel.org/r/20241219060214.1928848-1-hch@lst.de [1]
Fixes: 9377b95cda73 ("block: remove BLK_MQ_F_SHOULD_MERGE")
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Link: https://lore.kernel.org/r/20241220-merge-flag-fix-v1-1-41b7778dac06@kernel.org
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>rust: block: fix formatting in GenDisk doc</title>
<updated>2024-12-18T15:21:01Z</updated>
<author>
<name>Yutaro Ohno</name>
<email>yutaro.ono.418@gmail.com</email>
</author>
<published>2024-10-23T15:54:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0c5928deada15a8d075516e6e0d9ee19011bb000'/>
<id>urn:sha1:0c5928deada15a8d075516e6e0d9ee19011bb000</id>
<content type='text'>
Align bullet points and improve indentation in the `Invariants` section
of the `GenDisk` struct documentation for better readability.

[ Yutaro is also working on implementing the lint we suggested to catch
  this sort of issue in upstream Rust:

    https://github.com/rust-lang/rust-clippy/issues/13601
    https://github.com/rust-lang/rust-clippy/pull/13711

  Thanks a lot! - Miguel ]

Fixes: 3253aba3408a ("rust: block: introduce `kernel::block::mq` module")
Signed-off-by: Yutaro Ohno &lt;yutaro.ono.418@gmail.com&gt;
Reviewed-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Acked-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Link: https://lore.kernel.org/r/ZxkcU5yTFCagg_lX@ohnotp
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'block-6.13-20242901' of git://git.kernel.dk/linux</title>
<updated>2024-11-30T23:47:29Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-11-30T23:47:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cfd47302ac64b595beb0a67a337b81942146448a'/>
<id>urn:sha1:cfd47302ac64b595beb0a67a337b81942146448a</id>
<content type='text'>
Pull more block updates from Jens Axboe:

 - NVMe pull request via Keith:
      - Use correct srcu list traversal (Breno)
      - Scatter-gather support for metadata (Keith)
      - Fabrics shutdown race condition fix (Nilay)
      - Persistent reservations updates (Guixin)

 - Add the required bits for MD atomic write support for raid0/1/10

 - Correct return value for unknown opcode in ublk

 - Fix deadlock with zone revalidation

 - Fix for the io priority request vs bio cleanups

 - Use the correct unsigned int type for various limit helpers

 - Fix for a race in loop

 - Cleanup blk_rq_prep_clone() to prevent uninit-value warning and make
   it easier for actual humans to read

 - Fix potential UAF when iterating tags

 - A few fixes for bfq-iosched UAF issues

 - Fix for brd discard not decrementing the allocated page count

 - Various little fixes and cleanups

* tag 'block-6.13-20242901' of git://git.kernel.dk/linux: (36 commits)
  brd: decrease the number of allocated pages which discarded
  block, bfq: fix bfqq uaf in bfq_limit_depth()
  block: Don't allow an atomic write be truncated in blkdev_write_iter()
  mq-deadline: don't call req_get_ioprio from the I/O completion handler
  block: Prevent potential deadlock in blk_revalidate_disk_zones()
  block: Remove extra part pointer NULLify in blk_rq_init()
  nvme: tuning pr code by using defined structs and macros
  nvme: introduce change ptpl and iekey definition
  block: return bool from get_disk_ro and bdev_read_only
  block: remove a duplicate definition for bdev_read_only
  block: return bool from blk_rq_aligned
  block: return unsigned int from blk_lim_dma_alignment_and_pad
  block: return unsigned int from queue_dma_alignment
  block: return unsigned int from bdev_io_opt
  block: req-&gt;bio is always set in the merge code
  block: don't bother checking the data direction for merges
  block: blk-mq: fix uninit-value in blk_rq_prep_clone and refactor
  Revert "block, bfq: merge bfq_release_process_ref() into bfq_put_cooperator()"
  md/raid10: Atomic write support
  md/raid1: Atomic write support
  ...
</content>
</entry>
<entry>
<title>rust: block: simplify Result&lt;()&gt; in validate_block_size return</title>
<updated>2024-11-18T16:10:33Z</updated>
<author>
<name>Manas</name>
<email>manas18244@iiitd.ac.in</email>
</author>
<published>2024-11-18T14:36:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a3f143c461444c0b56360bbf468615fa814a8372'/>
<id>urn:sha1:a3f143c461444c0b56360bbf468615fa814a8372</id>
<content type='text'>
`Result` is used in place of `Result&lt;()&gt;` because the default type
parameters are unit `()` and `Error` types, which are automatically
inferred. Thus keep the usage consistent throughout codebase.

Suggested-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Link: https://github.com/Rust-for-Linux/linux/issues/1128
Signed-off-by: Manas &lt;manas18244@iiitd.ac.in&gt;
Reviewed-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Link: https://lore.kernel.org/r/20241118-simplify-result-v3-1-6b1566a77eab@iiitd.ac.in
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
