mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-09 00:00:17 +03:00
cmd_image: Flush journal before moving btree
We need the key cache to be flushed before moving btree nodes - key cache flushing won't obey the target we're moving btree nodes to. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
03d7318c31
commit
a0f12e09b6
@ -28,6 +28,7 @@
|
||||
#include "libbcachefs/alloc_foreground.h"
|
||||
#include "libbcachefs/data_update.h"
|
||||
#include "libbcachefs/errcode.h"
|
||||
#include "libbcachefs/journal_reclaim.h"
|
||||
#include "libbcachefs/move.h"
|
||||
#include "libbcachefs/opts.h"
|
||||
#include "libbcachefs/super-io.h"
|
||||
@ -91,6 +92,12 @@ static bool move_btree_pred(struct bch_fs *c, void *_arg,
|
||||
|
||||
static int move_btree(struct bch_fs *c, bool move_alloc, unsigned target_dev)
|
||||
{
|
||||
/*
|
||||
* Flush the key cache first, otherwise key cache flushing later will do
|
||||
* btree updates to the wrong device
|
||||
*/
|
||||
bch2_journal_flush_all_pins(&c->journal);
|
||||
|
||||
struct move_btree_args args = {
|
||||
.move_alloc = move_alloc,
|
||||
.target = dev_to_target(target_dev),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user