diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-03 00:37:15 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 17:47:39 +0100 |
commit | 183bcc89b855c412bfefa545b799006d66f689a6 (patch) | |
tree | 5f639310d3f967cc5f938d56f2a0f59382f07210 /fs/bcachefs/movinggc.c | |
parent | bcachefs: delete useless commit_do() (diff) | |
download | linux-183bcc89b855c412bfefa545b799006d66f689a6.tar.xz linux-183bcc89b855c412bfefa545b799006d66f689a6.zip |
bcachefs: Clean up btree write buffer write ref handling
__bch2_btree_write_buffer_flush() now assumes a write ref is already
held (as called by the transaction commit path); and the wrappers
bch2_write_buffer_flush() and flush_sync() take an explicit write ref.
This means internally the write buffer code can always use
BTREE_INSERT_NOCHECK_RW, instead of in the previous code passing flags
around and hoping the NOCHECK_RW flag was always carried around
correctly.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/movinggc.c')
-rw-r--r-- | fs/bcachefs/movinggc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c index b8d0542222c3..ba3a323a4843 100644 --- a/fs/bcachefs/movinggc.c +++ b/fs/bcachefs/movinggc.c @@ -154,6 +154,9 @@ static int bch2_copygc_get_buckets(struct moving_context *ctxt, move_buckets_wait(ctxt, buckets_in_flight, false); ret = bch2_btree_write_buffer_flush(trans); + if (bch2_err_matches(ret, EROFS)) + return ret; + if (bch2_fs_fatal_err_on(ret, c, "%s: error %s from bch2_btree_write_buffer_flush()", __func__, bch2_err_str(ret))) return ret; |