bcachefs: Suppress -EROFS messages when shutting down

This isn't actually an error condition, this just indicates a normal
shutdown - no reason for these to be in the log.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2022-10-12 16:11:31 -04:00
parent ef0732861a
commit 5f659376fc
3 changed files with 9 additions and 7 deletions

View File

@ -1976,10 +1976,10 @@ int bch2_gc_gens(struct bch_fs *c)
NULL, NULL,
BTREE_INSERT_NOFAIL,
gc_btree_gens_key(&trans, &iter, k));
if (ret) {
if (ret && ret != -EROFS)
bch_err(c, "error recalculating oldest_gen: %s", bch2_err_str(ret));
if (ret)
goto err;
}
}
ret = for_each_btree_key_commit(&trans, iter, BTREE_ID_alloc,
@ -1989,10 +1989,10 @@ int bch2_gc_gens(struct bch_fs *c)
NULL, NULL,
BTREE_INSERT_NOFAIL,
bch2_alloc_write_oldest_gen(&trans, &iter, k));
if (ret) {
if (ret && ret != -EROFS)
bch_err(c, "error writing oldest_gen: %s", bch2_err_str(ret));
if (ret)
goto err;
}
c->gc_gens_btree = 0;
c->gc_gens_pos = POS_MIN;

View File

@ -675,15 +675,17 @@ static void __bch2_write_index(struct bch_write_op *op)
op->written += sectors_start - keylist_sectors(keys);
if (ret) {
if (ret && !bch2_err_matches(ret, EROFS)) {
struct bkey_i *k = bch2_keylist_front(&op->insert_keys);
bch_err_inum_offset_ratelimited(c,
k->k.p.inode, k->k.p.offset << 9,
"write error while doing btree update: %s",
bch2_err_str(ret));
goto err;
}
if (ret)
goto err;
}
out:
/* If some a bucket wasn't written, we can't erasure code it: */

View File

@ -319,7 +319,7 @@ static int bch2_copygc(struct bch_fs *c)
writepoint_ptr(&c->copygc_write_point),
false,
copygc_pred, NULL);
if (ret < 0)
if (ret < 0 && ret != -EROFS)
bch_err(c, "error from bch2_move_data() in copygc: %s", bch2_err_str(ret));
if (ret)
return ret;