<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/md/md.c, branch v7.1-rc5</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1-rc5</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1-rc5'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-04-28T12:44:38+00:00</updated>
<entry>
<title>md: use ATTRIBUTE_GROUPS() for md default sysfs attributes</title>
<updated>2026-04-28T12:44:38+00:00</updated>
<author>
<name>Abd-Alrhman Masalkhi</name>
<email>abd.masalkhi@gmail.com</email>
</author>
<published>2026-04-23T10:13:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3b2f70eab5a2cd15e27b1447e66e45302b28ff2c'/>
<id>urn:sha1:3b2f70eab5a2cd15e27b1447e66e45302b28ff2c</id>
<content type='text'>
Replace the md_default_group and md_attr_groups with
ATTRIBUTE_GROUPS().

Signed-off-by: Abd-Alrhman Masalkhi &lt;abd.masalkhi@gmail.com&gt;
Link: https://lore.kernel.org/linux-raid/20260423101303.48196-4-abd.masalkhi@gmail.com
Signed-off-by: Yu Kuai &lt;yukuai@fnnas.com&gt;
</content>
</entry>
<entry>
<title>md: use mddev_is_dm() instead of open-coding gendisk checks</title>
<updated>2026-04-28T12:44:38+00:00</updated>
<author>
<name>Abd-Alrhman Masalkhi</name>
<email>abd.masalkhi@gmail.com</email>
</author>
<published>2026-04-23T10:13:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=408434a3245cc6ea981df4edd7fbf0be49856727'/>
<id>urn:sha1:408434a3245cc6ea981df4edd7fbf0be49856727</id>
<content type='text'>
Replace direct checks on mddev-&gt;gendisk with mddev_is_dm() in
md_handle_request() and md_run().

Signed-off-by: Abd-Alrhman Masalkhi &lt;abd.masalkhi@gmail.com&gt;
Link: https://lore.kernel.org/linux-raid/20260423101303.48196-3-abd.masalkhi@gmail.com
Signed-off-by: Yu Kuai &lt;yukuai@fnnas.com&gt;
</content>
</entry>
<entry>
<title>md/md-bitmap: add a none backend for bitmap grow</title>
<updated>2026-04-28T12:44:38+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai@fnnas.com</email>
</author>
<published>2026-04-25T02:46:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f2926a533d03fe70d753b512b713e06a2aa174af'/>
<id>urn:sha1:f2926a533d03fe70d753b512b713e06a2aa174af</id>
<content type='text'>
Add a real none bitmap backend that exposes the common bitmap sysfs
group and use it to keep bitmap/location available when an array has no
bitmap.

Then switch the bitmap location sysfs path to move only between none
and the classic bitmap backend, using the no-sysfs bitmap helpers while
merging or unmerging the internal bitmap sysfs group.

This restores mdadm --grow bitmap addition through bitmap/location.

Fixes: fb8cc3b0d9db ("md/md-bitmap: delay registration of bitmap_ops until creating bitmap")
Reviewed-by: Su Yue &lt;glass.su@suse.com&gt;
Link: https://lore.kernel.org/r/20260425024615.1696892-4-yukuai@fnnas.com
Signed-off-by: Yu Kuai &lt;yukuai@fnnas.com&gt;
</content>
</entry>
<entry>
<title>md/md-bitmap: split bitmap sysfs groups</title>
<updated>2026-04-28T12:44:37+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai@fnnas.com</email>
</author>
<published>2026-04-25T02:46:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aba3d6d6cb55c6e1116d1215140559dd7ecdf9a9'/>
<id>urn:sha1:aba3d6d6cb55c6e1116d1215140559dd7ecdf9a9</id>
<content type='text'>
Split the classic bitmap sysfs files into a common bitmap group with
the location attribute and a separate internal bitmap group for the
remaining files.

At the same time, convert bitmap operations from a single sysfs group
to a sysfs group array so backends can share part of their sysfs
layout while adding backend-specific attributes separately.

Switch the bitmap sysfs helpers to use sysfs_update_groups() for the
add and update path, and remove groups in reverse order so shared named
groups are unmerged before the last group removes the directory.

Also make bitmap operation lookup depend only on the currently selected
bitmap id matching the installed backend. This prepares the lookup path
for a later registered none backend.

Reviewed-by: Su Yue &lt;glass.su@suse.com&gt;
Link: https://lore.kernel.org/r/20260425024615.1696892-3-yukuai@fnnas.com
Signed-off-by: Yu Kuai &lt;yukuai@fnnas.com&gt;
</content>
</entry>
<entry>
<title>md: factor bitmap creation away from sysfs handling</title>
<updated>2026-04-28T12:44:37+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai@fnnas.com</email>
</author>
<published>2026-04-25T02:46:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8776d342cf8fa0b98ca5e6fb2d956966fb5ca364'/>
<id>urn:sha1:8776d342cf8fa0b98ca5e6fb2d956966fb5ca364</id>
<content type='text'>
Factor bitmap creation and destruction into helpers that do not touch
bitmap sysfs registration.

This prepares the bitmap sysfs rework so callers such as the sysfs
bitmap location path can create or destroy a bitmap backend without
coupling that to sysfs group lifetime management.

Reviewed-by: Su Yue &lt;glass.su@suse.com&gt;
Link: https://lore.kernel.org/r/20260425024615.1696892-2-yukuai@fnnas.com
Signed-off-by: Yu Kuai &lt;yukuai@fnnas.com&gt;
</content>
</entry>
<entry>
<title>md: replace wait loop with wait_event() in md_handle_request()</title>
<updated>2026-04-28T12:44:37+00:00</updated>
<author>
<name>Abd-Alrhman Masalkhi</name>
<email>abd.masalkhi@gmail.com</email>
</author>
<published>2026-04-15T14:03:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8e8278ac702e2d5d44211b4b10599aa3b2cb0555'/>
<id>urn:sha1:8e8278ac702e2d5d44211b4b10599aa3b2cb0555</id>
<content type='text'>
The wait loop is equivalent to wait_event() and can be simplified by
usaing it for improving readability.

Signed-off-by: Abd-Alrhman Masalkhi &lt;abd.masalkhi@gmail.com&gt;
Link: https://lore.kernel.org/r/20260415140319.376578-2-abd.masalkhi@gmail.com
Signed-off-by: Yu Kuai &lt;yukuai@fnnas.com&gt;
</content>
</entry>
<entry>
<title>md/raid5: Fix UAF on IO across the reshape position</title>
<updated>2026-04-28T12:44:37+00:00</updated>
<author>
<name>Benjamin Marzinski</name>
<email>bmarzins@redhat.com</email>
</author>
<published>2026-04-08T04:35:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=418b3e64e4459feb3f75979de9ec89e085745343'/>
<id>urn:sha1:418b3e64e4459feb3f75979de9ec89e085745343</id>
<content type='text'>
If make_stripe_request() returns STRIPE_WAIT_RESHAPE,
raid5_make_request() will free the cloned bio. But raid5_make_request()
can call make_stripe_request() multiple times, writing to the various
stripes. If that bio got added to the toread or towrite lists of a
stripe disk in an earlier call to make_stripe_request(), then it's not
safe to just free the bio if a later part of it is found to cross the
reshape position. Doing so can lead to a UAF error, when bio_endio()
is called on the bio for the earlier stripes.

Instead, raid5_make_request() needs to wait until all parts of the bio
have called bio_endio(). To do this, bios that cross the reshape
position while the reshape can't make progress are flagged as needing to
wait for all parts to complete. When raid5_make_request() has a bio that
failed make_stripe_request() with STRIPE_WAIT_RESHAPE, it sets
bi-&gt;bi_private to a completion struct and waits for completion after
ending the bio.  When the bio_endio() is called for the last time on a
clone bio with bi-&gt;bi_private set, it wakes up the waiter. This
guarantees that raid5_make_request() doesn't return until the cloned bio
needing a retry for io across the reshape boundary is safely cleaned up.

There is a simple reproducer available at [1]. Compile the kernel with
KASAN for more useful reporting when the error is triggered (this is not
necessary to see the bug).

[1] https://gist.github.com/bmarzins/e48598824305cf2171289e47d7241fa5

Signed-off-by: Benjamin Marzinski &lt;bmarzins@redhat.com&gt;
Reviewed-by: Xiao Ni &lt;xni@redhat.com&gt;
Link: https://lore.kernel.org/r/20260408043548.1695157-1-bmarzins@redhat.com
Signed-off-by: Yu Kuai &lt;yukuai@fnnas.com&gt;
</content>
</entry>
<entry>
<title>md: wake raid456 reshape waiters before suspend</title>
<updated>2026-04-07T05:09:22+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai@fnnas.com</email>
</author>
<published>2026-03-27T14:07:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cf86bb53b9c92354904a328e947a05ffbfdd1840'/>
<id>urn:sha1:cf86bb53b9c92354904a328e947a05ffbfdd1840</id>
<content type='text'>
During raid456 reshape, direct IO across the reshape position can sleep
in raid5_make_request() waiting for reshape progress while still
holding an active_io reference. If userspace then freezes reshape and
writes md/suspend_lo or md/suspend_hi, mddev_suspend() kills active_io
and waits for all in-flight IO to drain.

This can deadlock: the IO needs reshape progress to continue, but the
reshape thread is already frozen, so the active_io reference is never
dropped and suspend never completes.

raid5_prepare_suspend() already wakes wait_for_reshape for dm-raid. Do
the same for normal md suspend when reshape is already interrupted, so
waiting raid456 IO can abort, drop its reference, and let suspend
finish.

The mdadm test tests/25raid456-reshape-deadlock reproduces the hang.

Fixes: 714d20150ed8 ("md: add new helpers to suspend/resume array")
Link: https://lore.kernel.org/linux-raid/20260327140729.2030564-1-yukuai@fnnas.com/
Signed-off-by: Yu Kuai &lt;yukuai@fnnas.com&gt;
</content>
</entry>
<entry>
<title>md/raid1: serialize overlap io for writemostly disk</title>
<updated>2026-04-07T05:09:22+00:00</updated>
<author>
<name>Xiao Ni</name>
<email>xni@redhat.com</email>
</author>
<published>2026-03-24T07:24:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=808cec74601cfddea87b6970134febfdc7f574b9'/>
<id>urn:sha1:808cec74601cfddea87b6970134febfdc7f574b9</id>
<content type='text'>
Previously, using wait_event() would wake up all waiters simultaneously,
and they would compete for the tree lock. The bio which gets the lock
first will be handled, so the write sequence cannot be guaranteed.

For example:
bio1(100,200)
bio2(150,200)
bio3(150,300)

The write sequence of fast device is bio1,bio2,bio3. But the write sequence
of slow device could be bio1,bio3,bio2 due to lock competition. This causes
data corruption.

Replace waitqueue with a fifo list to guarantee the write sequence. And it
also needs to iterate the list when removing one entry. If not, it may miss
the opportunity to wake up the waiting io.

For example:
bio1(1,3), bio2(2,4)
bio3(5,7), bio4(6,8)
These four bios are in the same bucket. bio1 and bio3 are inserted into
the rbtree. bio2 and bio4 are added to the waiting list and bio2 is the
first one. bio3 returns from slow disk and tries to wake up the waiting
bios. bio2 is removed from the list and will be handled. But bio1 hasn't
finished. So bio2 will be added into waiting list again. Then bio1 returns
from slow disk and wakes up waiting bios. bio4 is removed from the list
and will be handled. Now bio1, bio3 and bio4 all finish and bio2 is left
on the waiting list. So it needs to iterate the waiting list to wake up
the right bio.

Signed-off-by: Xiao Ni &lt;xni@redhat.com&gt;
Link: https://lore.kernel.org/linux-raid/20260324072501.59865-1-xni@redhat.com/
Signed-off-by: Yu Kuai &lt;yukuai@fnnas.com&gt;
</content>
</entry>
<entry>
<title>md: add fallback to correct bitmap_ops on version mismatch</title>
<updated>2026-04-07T05:09:22+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai@fnnas.com</email>
</author>
<published>2026-03-23T05:46:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=09af773650024279a60348e7319d599e6571b15c'/>
<id>urn:sha1:09af773650024279a60348e7319d599e6571b15c</id>
<content type='text'>
If default bitmap version and on-disk version doesn't match, and mdadm
is not the latest version to set bitmap_type, set bitmap_ops based on
the disk version.

Link: https://lore.kernel.org/linux-raid/20260323054644.3351791-2-yukuai@fnnas.com/
Signed-off-by: Yu Kuai &lt;yukuai@fnnas.com&gt;
</content>
</entry>
</feed>
