]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: bch2_write_inode() now checks for changing rebalance options
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 21 Oct 2024 00:53:53 +0000 (20:53 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 21 Dec 2024 06:36:16 +0000 (01:36 -0500)
commit4ae6bbb522f59aef34bb7fb3f7048ecaf72f0ab7
tree71ef2570042ecd166a34b289bbfc25a5ec63e543
parent2d21d112538ea3b5f35a92fded43324dc693af25
bcachefs: bch2_write_inode() now checks for changing rebalance options

Previously, BCHFS_IOC_REINHERIT_ATTRS didn't trigger rebalance scans
when changing rebalance options - it had been missed, only the xattr
interface triggered them.

Ideally they'd be done by the transactional trigger, but unpacking the
inode to get the options is too heavy to be done in the low level
trigger - the inode trigger is run on every extent update, since the
bch_inode.bi_journal_seq has to be updated for fsync.

bch2_write_inode() is a good compromise, it already unpacks and repacks
and is not run in any super-fast paths.

Additionally, creating the new rebalance entry to trigger the scan is
now done in the same transaction as the inode update that changed the
options.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs.c
fs/bcachefs/inode.h
fs/bcachefs/rebalance.c
fs/bcachefs/rebalance.h
fs/bcachefs/xattr.c