rebalance + reflink improvements
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest12 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | bcachefs: Don't keep tons of cached pointers aroundfs/ fs/ fs/ +2 more | +89 | 0 replies | |
| 2/12 | bcachefs: use bch2_data_update_opts_to_text() in trace_move_extent_fail()fs/ | +14 | 0 replies | |
| 3/12 | bcachefs: bch2_io_opts_fixups()fs/ fs/ fs/ +3 more | +21 | 0 replies | |
| 4/12 | bcachefs: small cleanup for extent ptr bitmasksfs/ fs/ fs/ | +24 | 0 replies | |
| 5/12 | bcachefs: kill bch2_bkey_needs_rebalance()fs/ fs/ | +0 | 0 replies | |
| 6/12 | bcachefs: kill __bch2_bkey_sectors_need_rebalance()fs/ | +10 | 0 replies | |
| 7/12 | bcachefs: rename bch_extent_rebalance fields to match other opts structsfs/ fs/ fs/ | +28 | 0 replies | |
| 8/12 | bcachefs: io_opts_to_rebalance_opts()fs/ fs/ fs/ +5 more | +39 | 0 replies | |
| 9/12 | bcachefs: Add bch_io_opts fields for indicating whether the opts came from the inodefs/ fs/ | +10 | 0 replies | |
| 10/12 | bcachefs: New bch_extent_rebalance fieldsfs/ fs/ fs/ +4 more | +138 | 0 replies | |
| 11/12 | bcachefs: bch2_indirect_extent_error()fs/ fs/ fs/ | +22 | 0 replies | |
| 12/12 | bcachefs: bch2_write_inode() now checks for changing rebalance optionsfs/ fs/ fs/ +2 more | +32 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/12] rebalance + reflink improvements
Reed Riley found an interesting bug where too many cached replicas were being kept around in extents, and the data update path barfed when it hit the limit.
Fixing this meant adding some sort of policy for when we keep a cached copy around (answer: we now keep one, if a promote target is set and it's on the promote target).
But for that to work properly, the data update path needs to know what the promote target is...
This series plumbs the full set of io path options that apply to rebalance through bch_extent_rebalance (i.e. they're kept with the extent when needed, meaning they're available for indirect extents), regularizes and cleans up a fair amount of stuff, and makes it possible for new options to take effect over the options in bch_extent_rebalance, in the extent (we now track whether the option came from the inode or the filesystem, so inode options can correctly take precedence).
data_replicas and data_checksum are now plumbed through bch_extent_rebalance, as well.
Things that did not make the cut:
- Setting new options on a file doesn't yet apply them to indirect extents. I wrote the code for this, but it's a security hole without knowing if this was "your" reflinked data, or copied from another user. Handling this will probably require bch_reflink_p_v2.
- Rebalance doesn't yet apply new data_replicas settings in the background, like it does for the compression and target options (this would remove the need to manually run 'bcachefs rereplicate'.
This one will be easier to do, but I think I want to do some cleanup on data_opts next.
The first patch in the series will go to Linus shortly, the rest next merge window.
Kent Overstreet (12):
bcachefs: Don't keep tons of cached pointers around
bcachefs: use bch2_data_update_opts_to_text() in
trace_move_extent_fail()
bcachefs: bch2_io_opts_fixups()
bcachefs: small cleanup for extent ptr bitmasks
bcachefs: kill bch2_bkey_needs_rebalance()
bcachefs: kill __bch2_bkey_sectors_need_rebalance()
bcachefs: rename bch_extent_rebalance fields to match other opts
structs
bcachefs: io_opts_to_rebalance_opts()
bcachefs: Add bch_io_opts fields for indicating whether the opts came
from the inode
bcachefs: New bch_extent_rebalance fields
bcachefs: bch2_indirect_extent_error()
bcachefs: bch2_write_inode() now checks for changing rebalance options
fs/bcachefs/data_update.c | 88 +++++++------- fs/bcachefs/data_update.h | 3 +- fs/bcachefs/extents.c | 223 +++++++++++++++++++---------------- fs/bcachefs/extents.h | 13 +- fs/bcachefs/extents_format.h | 45 ++++++- fs/bcachefs/fs.c | 26 +++- fs/bcachefs/inode.c | 12 +- fs/bcachefs/inode.h | 8 ++ fs/bcachefs/io_misc.c | 2 +- fs/bcachefs/io_read.c | 31 ++--- fs/bcachefs/io_write.c | 2 +- fs/bcachefs/move.c | 90 ++++++++++---- fs/bcachefs/move.h | 5 +- fs/bcachefs/opts.c | 5 +- fs/bcachefs/opts.h | 29 ++++- fs/bcachefs/rebalance.c | 48 +++----- fs/bcachefs/rebalance.h | 1 + fs/bcachefs/reflink.c | 15 ++- fs/bcachefs/reflink.h | 2 + fs/bcachefs/xattr.c | 7 -- 20 files changed, 393 insertions(+), 262 deletions(-)
Signature · 1 line
2.45.2