diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-10-12 16:11:31 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-03 21:48:48 -0500 |
commit | 80f9d8d85ea02074d0a6a8c9ed98c5ab0f88f8ec (patch) | |
tree | 5adaa6203aeb4fd376ef8e81e9ee23d83deccf4d | |
parent | f83fa4150a205f4d484e4b6a69215c6095041f13 (diff) |
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>
-rw-r--r-- | fs/bcachefs/btree_gc.c | 8 | ||||
-rw-r--r-- | fs/bcachefs/io.c | 6 | ||||
-rw-r--r-- | fs/bcachefs/movinggc.c | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c index 719262963516..529db171b834 100644 --- a/fs/bcachefs/btree_gc.c +++ b/fs/bcachefs/btree_gc.c @@ -1979,10 +1979,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, @@ -1992,10 +1992,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; diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index 049c5b1ab095..120ab59bad87 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -676,15 +676,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: */ diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c index 469cb37fa1ba..b07e60394f39 100644 --- a/fs/bcachefs/movinggc.c +++ b/fs/bcachefs/movinggc.c @@ -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; |