<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/md/dm-thin.c, branch v6.18.21</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-08-19T09:12:50+00:00</updated>
<entry>
<title>dm: use vmalloc_array() to simplify code</title>
<updated>2025-08-19T09:12:50+00:00</updated>
<author>
<name>Qianfeng Rong</name>
<email>rongqianfeng@vivo.com</email>
</author>
<published>2025-08-06T12:27:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c3797175b3673b3a38d59991f7bf4762bce016dd'/>
<id>urn:sha1:c3797175b3673b3a38d59991f7bf4762bce016dd</id>
<content type='text'>
Remove array_size() calls and replace vmalloc() with vmalloc_array() to
simplify the code.

Signed-off-by: Qianfeng Rong &lt;rongqianfeng@vivo.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: set DM_TARGET_PASSES_CRYPTO feature for dm-thin</title>
<updated>2025-07-31T14:30:02+00:00</updated>
<author>
<name>LongPing Wei</name>
<email>weilongping@oppo.com</email>
</author>
<published>2025-07-30T06:17:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=55a0fbd2ac3fe8f61a30ea697b2eb3034f6778c8'/>
<id>urn:sha1:55a0fbd2ac3fe8f61a30ea697b2eb3034f6778c8</id>
<content type='text'>
dm-thin obviously can pass through inline crypto support.

Signed-off-by: LongPing Wei &lt;weilongping@oppo.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-6.13/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm</title>
<updated>2025-01-08T18:12:01+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-01-08T18:12:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0b7958fa05d562e514fd0abe2a4800042abf868b'/>
<id>urn:sha1:0b7958fa05d562e514fd0abe2a4800042abf868b</id>
<content type='text'>
Pull device mapper fixes from Mikulas Patocka:

 - dm-array fixes

 - dm-verity forward error correction fixes

 - remove the flag DM_TARGET_PASSES_INTEGRITY from dm-ebs

 - dm-thin RCU list fix

* tag 'for-6.13/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm thin: make get_first_thin use rcu-safe list first function
  dm-ebs: don't set the flag DM_TARGET_PASSES_INTEGRITY
  dm-verity FEC: Avoid copying RS parity bytes twice.
  dm-verity FEC: Fix RS FEC repair for roots unaligned to block size (take 2)
  dm array: fix cursor index when skipping across block boundaries
  dm array: fix unreleased btree blocks on closing a faulty array cursor
  dm array: fix releasing a faulty array block twice in dm_array_cursor_end
</content>
</entry>
<entry>
<title>dm thin: make get_first_thin use rcu-safe list first function</title>
<updated>2025-01-08T14:29:39+00:00</updated>
<author>
<name>Krister Johansen</name>
<email>kjlx@templeofstupid.com</email>
</author>
<published>2025-01-07T23:24:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=80f130bfad1dab93b95683fc39b87235682b8f72'/>
<id>urn:sha1:80f130bfad1dab93b95683fc39b87235682b8f72</id>
<content type='text'>
The documentation in rculist.h explains the absence of list_empty_rcu()
and cautions programmers against relying on a list_empty() -&gt;
list_first() sequence in RCU safe code.  This is because each of these
functions performs its own READ_ONCE() of the list head.  This can lead
to a situation where the list_empty() sees a valid list entry, but the
subsequent list_first() sees a different view of list head state after a
modification.

In the case of dm-thin, this author had a production box crash from a GP
fault in the process_deferred_bios path.  This function saw a valid list
head in get_first_thin() but when it subsequently dereferenced that and
turned it into a thin_c, it got the inside of the struct pool, since the
list was now empty and referring to itself.  The kernel on which this
occurred printed both a warning about a refcount_t being saturated, and
a UBSAN error for an out-of-bounds cpuid access in the queued spinlock,
prior to the fault itself.  When the resulting kdump was examined, it
was possible to see another thread patiently waiting in thin_dtr's
synchronize_rcu.

The thin_dtr call managed to pull the thin_c out of the active thins
list (and have it be the last entry in the active_thins list) at just
the wrong moment which lead to this crash.

Fortunately, the fix here is straight forward.  Switch get_first_thin()
function to use list_first_or_null_rcu() which performs just a single
READ_ONCE() and returns NULL if the list is already empty.

This was run against the devicemapper test suite's thin-provisioning
suites for delete and suspend and no regressions were observed.

Signed-off-by: Krister Johansen &lt;kjlx@templeofstupid.com&gt;
Fixes: b10ebd34ccca ("dm thin: fix rcu_read_lock being held in code that can sleep")
Cc: stable@vger.kernel.org
Acked-by: Ming-Hung Tsai &lt;mtsai@redhat.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-6.13/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm</title>
<updated>2024-11-26T02:54:00+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-11-26T02:54:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7eef7e306d3c40a0c5b9ff6adc9b273cc894dbd5'/>
<id>urn:sha1:7eef7e306d3c40a0c5b9ff6adc9b273cc894dbd5</id>
<content type='text'>
Pull device mapper updates from Mikulas Patocka:

 - remove unused functions and variables

 - rate-limit error messages in syslog

 - fix typo

 - remove u64 alignment requirement for murmurhash

 - reset bi_ioprio to the default for dm-vdo

 - add support for get_unique_id

 - Add missing destroy_work_on_stack() to dm-thin

 - use kmalloc to allocate power-of-two sized buffers in bufio

* tag 'for-6.13/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm-verity: remove the unused "data_start" variable
  dm-bufio: use kmalloc to allocate power-of-two sized buffers
  dm thin: Add missing destroy_work_on_stack()
  dm: add support for get_unique_id
  dm vdo: fix function doc comment formatting
  dm vdo int-map: remove unused parameters
  dm-vdo: reset bi_ioprio to the default value when the bio is reset
  dm-vdo murmurhash: remove u64 alignment requirement
  dm: Fix typo in error message
  dm ioctl: rate limit a couple of ioctl based error messages
  dm vdo: Remove unused uds_compute_index_size
  dm vdo: Remove unused functions
  dm: zoned: Remove unused functions
  dm: Remove unused dm_table_bio_based
  dm: Remove unused dm_set_md_type
  dm cache: Remove unused functions in bio-prison-v1
  dm cache: Remove unused dm_cache_size
  dm cache: Remove unused dm_cache_dump
  dm cache: Remove unused btracker_nr_writebacks_queued
</content>
</entry>
<entry>
<title>dm thin: Add missing destroy_work_on_stack()</title>
<updated>2024-11-20T10:38:05+00:00</updated>
<author>
<name>Yuan Can</name>
<email>yuancan@huawei.com</email>
</author>
<published>2024-11-06T01:03:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e74fa2447bf9ed03d085b6d91f0256cc1b53f1a8'/>
<id>urn:sha1:e74fa2447bf9ed03d085b6d91f0256cc1b53f1a8</id>
<content type='text'>
This commit add missed destroy_work_on_stack() operations for pw-&gt;worker in
pool_work_wait().

Fixes: e7a3e871d895 ("dm thin: cleanup noflush_work to use a proper completion")
Cc: stable@vger.kernel.org
Signed-off-by: Yuan Can &lt;yuancan@huawei.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: add a bdev_limits helper</title>
<updated>2024-10-29T15:15:00+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-10-29T14:19:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2f5a65ef30a636d5030917eebd283ac447a212af'/>
<id>urn:sha1:2f5a65ef30a636d5030917eebd283ac447a212af</id>
<content type='text'>
Add a helper to get the queue_limits from the bdev without having to
poke into the request_queue.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Link: https://lore.kernel.org/r/20241029141937.249920-1-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>dm: Convert to use ERR_CAST()</title>
<updated>2024-09-02T09:41:11+00:00</updated>
<author>
<name>Yuesong Li</name>
<email>liyuesong@vivo.com</email>
</author>
<published>2024-08-30T03:16:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=00565cff01262c888512bffe9d41e4831a6f2cc7'/>
<id>urn:sha1:00565cff01262c888512bffe9d41e4831a6f2cc7</id>
<content type='text'>
Use ERR_CAST() as it is designed for casting an error pointer to
another type.

This macro utilizes the __force and __must_check modifiers, which instruct
the compiler to verify for errors at the locations where it is employed.

Signed-off-by: Yuesong Li &lt;liyuesong@vivo.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: stop using blk_limits_io_{min,opt}</title>
<updated>2024-07-10T11:10:06+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-07-03T13:12:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0a94a469a4f02bdcc223517fd578810ffc21c548'/>
<id>urn:sha1:0a94a469a4f02bdcc223517fd578810ffc21c548</id>
<content type='text'>
Remove use of the blk_limits_io_{min,opt} and assign the values directly
to the queue_limits structure.  For the io_opt this is a completely
mechanical change, for io_min it removes flooring the limit to the
physical and logical block size in the particular caller.  But as
blk_validate_limits will do the same later when actually applying the
limits, there still is no change in overall behavior.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-6.10/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm</title>
<updated>2024-05-21T18:43:11+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-05-21T18:43:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=856726396d6548ef21a9b02e5b685ec39e555248'/>
<id>urn:sha1:856726396d6548ef21a9b02e5b685ec39e555248</id>
<content type='text'>
Pull device mapper fixes from Mike Snitzer:

 - Fix DM discard regressions due to DM core switching over to using
   queue_limits_set() without DM core and targets first being updated to
   set (and stack) discard limits in terms of max_hw_discard_sectors and
   not max_discard_sectors

 - Fix stable@ DM integrity discard support to set device's
   discard_granularity limit to the device's logical block size

* tag 'for-6.10/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm: always manage discard support in terms of max_hw_discard_sectors
  dm-integrity: set discard_granularity to logical block size
</content>
</entry>
</feed>
