bcachefs: Don't log errors that are expected during shutdown
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 9 Mar 2020 18:19:58 +0000 (14:19 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:36 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/io.c
fs/bcachefs/io.h
fs/bcachefs/move.c

index 5f296de282b6abfa09bbb0e9700a10b0e30e0bac..717332072d875138a48f539877f86cfe3e017b85 100644 (file)
@@ -1222,7 +1222,8 @@ void bch2_write(struct closure *cl)
 
        if (c->opts.nochanges ||
            !percpu_ref_tryget(&c->writes)) {
-               __bcache_io_error(c, "read only");
+               if (!(op->flags & BCH_WRITE_FROM_INTERNAL))
+                       __bcache_io_error(c, "read only");
                op->error = -EROFS;
                goto err;
        }
index bc9f9fec2fd7d5f022c9f88f0cab3b74f27d7f3d..c250bceb77ea3db0af62f25f4c9166017c32e347 100644 (file)
@@ -35,10 +35,11 @@ enum bch_write_flags {
        BCH_WRITE_ONLY_SPECIFIED_DEVS   = (1 << 6),
        BCH_WRITE_NOPUT_RESERVATION     = (1 << 7),
        BCH_WRITE_WROTE_DATA_INLINE     = (1 << 8),
+       BCH_WRITE_FROM_INTERNAL         = (1 << 9),
 
        /* Internal: */
-       BCH_WRITE_JOURNAL_SEQ_PTR       = (1 << 9),
-       BCH_WRITE_SKIP_CLOSURE_PUT      = (1 << 10),
+       BCH_WRITE_JOURNAL_SEQ_PTR       = (1 << 10),
+       BCH_WRITE_SKIP_CLOSURE_PUT      = (1 << 11),
 };
 
 static inline u64 *op_journal_seq(struct bch_write_op *op)
index dbcda83746924b17ca898ce60427fb6a44c830bf..a9a72963e1b71ba9c31fd2789a508faf818298b6 100644 (file)
@@ -242,7 +242,8 @@ int bch2_migrate_write_init(struct bch_fs *c, struct migrate_write *m,
        m->op.flags |= BCH_WRITE_ONLY_SPECIFIED_DEVS|
                BCH_WRITE_PAGES_STABLE|
                BCH_WRITE_PAGES_OWNED|
-               BCH_WRITE_DATA_ENCODED;
+               BCH_WRITE_DATA_ENCODED|
+               BCH_WRITE_FROM_INTERNAL;
 
        m->op.nr_replicas       = 1;
        m->op.nr_replicas_required = 1;