From 8b45d8f1a11520798f2476b672c5d7b8d0358c91 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 13 Dec 2022 20:30:10 -0500 Subject: bcachefs: Suppress expected -EROFS error messages These errors are expected during the shutdown process, and shouldn't be printed. Signed-off-by: Kent Overstreet --- fs/bcachefs/io.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index 706f18bc4238..2bff7a24a830 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -753,15 +753,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: */ @@ -1362,13 +1364,16 @@ static void bch2_nocow_write_convert_unwritten(struct bch_write_op *op) bch2_nocow_write_convert_one_unwritten(&trans, &iter, orig, k, op->new_i_size); })); - 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)); + } + + if (ret) { op->error = ret; break; } -- cgit v1.2.3