blk_holder_ops, freeze/thaw
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest7 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | fs: export invalidate_inodes()fs/ fs/ include/ | +2 | 2 replies | |
| 2/7 | bcachefs: Stash a pointer to the filesystem for blk_holder_opsfs/ fs/ fs/ | +15 | 0 replies | |
| 3/7 | bcachefs: Make sure c->vfs_sb is set before starting fsfs/ | +8 | 0 replies | |
| 4/7 | bcachefs: Implement blk_holder_opsfs/ fs/ fs/ | +99 | 0 replies | |
| 5/7 | bcachefs: Fix btree_node_scan io_ref handlingfs/ | +8 | 0 replies | |
| 6/7 | bcachefs: bch2_dev_get_ioref() may now sleepfs/ fs/ | +6 | 0 replies | |
| 7/7 | bcachefs: Implement freeze/thawfs/ fs/ fs/ +2 more | +136 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/7] blk_holder_ops, freeze/thaw
Until now, it turns out bcachefs has been lacking freeze/thaw support, which is important for hibernate.
We thought we had freeze/thaw support, but it turns out that when .freeze_fs and .unfreeze_fs were implemented in super_operations, they were never being called - those functions are only called from the blk_holder callbacks, and the engineer implementing them never thought to check that.
So - there's a lesson here, and this is why I keep harping on testing. It's not enough to just fire off the automated test suite and call it a day, you do have to put actual thought into checking that your code is behaving as expected :)
It turns out the method we were originally talking about for freeze/thaw of just using our existing read-only/read-write paths doesn't work, for reasons that I neglected to remember when hooking up blk_holder_ops (locking and conflicting state management, I assume), so we need to block IOs at a lower level - which conveniently we can do with our existing per-device IO references.
This patchset also implements the other blk holder ops - the big one being mark_dead, which now offlines a single device from the filesystem if possible (leaving the filesystem read-write), or if not possible to run in degraded mode, sets the entire filesystem read only.
Kent Overstreet (7):
fs: export invalidate_inodes()
bcachefs: Stash a pointer to the filesystem for blk_holder_ops
bcachefs: Make sure c->vfs_sb is set before starting fs
bcachefs: Implement blk_holder_ops
bcachefs: Fix btree_node_scan io_ref handling
bcachefs: bch2_dev_get_ioref() may now sleep
bcachefs: Implement freeze/thaw
fs/bcachefs/bcachefs.h | 3 + fs/bcachefs/btree_node_scan.c | 17 ++- fs/bcachefs/fs.c | 11 +- fs/bcachefs/journal_io.c | 7 +- fs/bcachefs/sb-members.c | 49 +++++++++ fs/bcachefs/sb-members.h | 18 +--- fs/bcachefs/super-io.c | 5 +- fs/bcachefs/super.c | 191 +++++++++++++++++++++++++++++++++- fs/bcachefs/super.h | 2 + fs/bcachefs/super_types.h | 8 +- fs/inode.c | 1 + fs/internal.h | 1 - include/linux/fs.h | 1 + 13 files changed, 272 insertions(+), 42 deletions(-)
Signature · 1 line
2.47.2