<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/bcachefs/data_update.c, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-04-06T23:13:43Z</updated>
<entry>
<title>bcachefs: Fix escape sequence in prt_printf</title>
<updated>2025-04-06T23:13:43Z</updated>
<author>
<name>Gabriel Shahrouzi</name>
</author>
<published>2025-04-04T01:28:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f5cd27ec714628b522af8c588d3907671404385e'/>
<id>urn:sha1:f5cd27ec714628b522af8c588d3907671404385e</id>
<content type='text'>
Remove backslash before format specifier. Ensure correct output.

Signed-off-by: Gabriel Shahrouzi &lt;gshahrouzi@gmail.com&gt;
Signed-off-by: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
</content>
</entry>
<entry>
<title>bcachefs: Kill btree_iter.trans</title>
<updated>2025-04-02T14:24:34Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2025-03-21T19:18:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9180ad2e161b7030e0af78fd2266cbcefe81e652'/>
<id>urn:sha1:9180ad2e161b7030e0af78fd2266cbcefe81e652</id>
<content type='text'>
This was planned to be done ages ago, now finally completed; there are
places where we have quite a few btree_trans objects on the stack, so
this reduces stack usage somewhat.

Signed-off-by: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
</content>
</entry>
<entry>
<title>bcachefs: Log original key being moved in data updates</title>
<updated>2025-03-30T22:25:12Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2025-03-30T20:57:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7fdc3fa3cb5fb561f5945b4de418d48d1a726a8d'/>
<id>urn:sha1:7fdc3fa3cb5fb561f5945b4de418d48d1a726a8d</id>
<content type='text'>
There's something going on with the data move path; log the original key
being moved for debugging.

Signed-off-by: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
</content>
</entry>
<entry>
<title>bcachefs: EIO cleanup</title>
<updated>2025-03-24T13:50:36Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2025-03-20T14:16:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a9f3d058279ed0f99114e0449d129fb5abc5eca'/>
<id>urn:sha1:8a9f3d058279ed0f99114e0449d129fb5abc5eca</id>
<content type='text'>
Replace these with proper private error codes, so that when we get an
error message we're not sifting through the entire codebase to see where
it came from.

Signed-off-by: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
</content>
</entry>
<entry>
<title>bcachefs: Improve can_write_extent()</title>
<updated>2025-03-24T13:50:34Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2025-03-16T01:32:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9962cb77488f617963d0314e8c9120315d97ea18'/>
<id>urn:sha1:9962cb77488f617963d0314e8c9120315d97ea18</id>
<content type='text'>
This fixes another "rebalance spinning and doing no work" issue;
rebalance was reading extents it wanted to move, but then failing in
bch2_write() -&gt; bch2_alloc_sectors_start() due to being unable to
allocate sufficient replicas.

This was triggered by a user playing with the durability settings, the
foreground device was an NVME device with durability=2, and originally
he'd set the background device to durability=2 as well, but changed it
back to 1 (the default) after seeing IO errors.

That meant that with replicas=2, we want to move data off the NVME
device which satisfies that constraint, but with a single durability=1
device on the background target there's no way to move the extent to
that target while satisfiying the "required replicas" constraint.

The solution for now is for bch2_data_update_init() to check for this,
and return an error - before kicking off the read.

bch2_data_update_init() already had two different checks for "will we be
able to write this extent", with partially duplicated code, so this
patch combines and improves that logic.

Additionally, we now always bail out and return an error if there's
insufficient space on the destination target. Previously, we only did
this for BCH_WRITE_alloc_nowait moves, because it might be the case that
copygc just needs to free up space on the destination target.

But we really shouldn't kick off a move if the destination is full, we
can't currently distinguish between "really full" and "just need to wait
for copygc", and if we are going to wait on copygc it'd be better to do
that before kicking off the move.

This will additionally fix "rebalance spinning" issues caused by a
filesystem that has more data than can fit in background_target - which
is a valid scenario, since we don't exclude foreground/cache devices
when calculating filesystem capacity.

Reported-by: Maël Kerbiriou &lt;mael.kerbiriou@free.fr&gt;
Signed-off-by: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
</content>
</entry>
<entry>
<title>bcachefs: BCH_READ_data_update -&gt; bch_read_bio.data_update</title>
<updated>2025-03-24T13:50:34Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2025-03-12T20:56:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3fb8bacb14b6fb7a0040177bb7766f5c7bd68913'/>
<id>urn:sha1:3fb8bacb14b6fb7a0040177bb7766f5c7bd68913</id>
<content type='text'>
Read flags are codepath dependent and change as they're passed around,
while the fields in rbio._state are mostly fixed properties of that
particular object.

Losing track of BCH_READ_data_update would be bad, and previously it was
not obvious if it was always correctly set in the rbio, so this is a
safety cleanup.

Signed-off-by: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
</content>
</entry>
<entry>
<title>bcachefs: data_update now checks for extents that can't be moved</title>
<updated>2025-03-15T01:02:15Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2025-02-28T16:37:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7bc580816869e31c121eefe26e7eaccd4e3b778b'/>
<id>urn:sha1:7bc580816869e31c121eefe26e7eaccd4e3b778b</id>
<content type='text'>
If a device is ro or failed, we might not have anywhere to move a
replica.

Check for this early, before doing the read and attempting to write.

Signed-off-by: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
</content>
</entry>
<entry>
<title>bcachefs: Read/move path counter work</title>
<updated>2025-03-15T01:02:12Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2025-02-04T01:15:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=157ea5834133c02cb93e06e6a014cfc0b3b109e5'/>
<id>urn:sha1:157ea5834133c02cb93e06e6a014cfc0b3b109e5</id>
<content type='text'>
Reorganize counters a bit, grouping related counters together.

New counters:
- io_read_inline
- io_read_hole

Signed-off-by: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
</content>
</entry>
<entry>
<title>bcachefs: Scrub</title>
<updated>2025-03-15T01:02:12Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2024-12-29T00:59:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f269ae55d2de9c6aff5b289cd94c8eaab7b9b2c3'/>
<id>urn:sha1:f269ae55d2de9c6aff5b289cd94c8eaab7b9b2c3</id>
<content type='text'>
Add a new data op to walk all data and metadata in a filesystem,
checking if it can be read successfully, and on error repairing from
another copy if possible.

- New helper: bch2_dev_idx_is_online(), so that we can bail out and
  report to userspace when we're unable to scrub because the device is
  offline

- data_update_opts, which controls the data move path, now understands
  scrub: data is only read, not written. The read path is responsible
  for rewriting on read error, as with other reads.

- scrub_pred skips data extents that don't have checksums

- bch_ioctl_data has a new scrub member, which has a data_types field
  for data types to check - i.e. all data types, or only metadata.

- Add new entries to bch_move_stats so that we can report numbers for
  corrected and uncorrected errors

- Add a new enum to bch_ioctl_data_event for explicitly reporting
  completion and return code (i.e. device offline)

Signed-off-by: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
</content>
</entry>
<entry>
<title>bcachefs: Bail out early on alloc_nowait data updates</title>
<updated>2025-03-15T01:02:11Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2025-01-19T18:55:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7e9ed60f5fe58dd4b4b6dcf63e57154c6262a2af'/>
<id>urn:sha1:7e9ed60f5fe58dd4b4b6dcf63e57154c6262a2af</id>
<content type='text'>
If a data update doesn't want to block on allocations (promotes, self
healing on read error) - check if the allocation would fail before
kicking off the data update and calling into the write path.

Signed-off-by: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
</content>
</entry>
</feed>
