]> www.infradead.org Git - users/hch/misc.git/commitdiff
bcachefs: minor journal errcode cleanup
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 12 Feb 2025 14:47:39 +0000 (09:47 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 15 Mar 2025 01:02:14 +0000 (21:02 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal.c
fs/bcachefs/journal_io.c

index 40d3ad5a1e5c5afe11d86e49878f444679080d1b..8d4f3bfaa228d4c3b2fe858c994460f53bbdab18 100644 (file)
@@ -981,7 +981,7 @@ int bch2_journal_meta(struct journal *j)
        struct bch_fs *c = container_of(j, struct bch_fs, journal);
 
        if (!bch2_write_ref_tryget(c, BCH_WRITE_REF_journal))
-               return -EROFS;
+               return -BCH_ERR_erofs_no_writes;
 
        int ret = __bch2_journal_meta(j);
        bch2_write_ref_put(c, BCH_WRITE_REF_journal);
index 61f71e7baff2dfb0f26b9c2e7fe20bf140dc15e4..7d59ccc073154f67c7a4b66e32e58a6e902b9300 100644 (file)
@@ -1515,7 +1515,7 @@ static void __journal_write_alloc(struct journal *j,
  * @j:         journal object
  * @w:         journal buf (entry to be written)
  *
- * Returns: 0 on success, or -EROFS on failure
+ * Returns: 0 on success, or -BCH_ERR_insufficient_devices on failure
  */
 static int journal_write_alloc(struct journal *j, struct journal_buf *w)
 {
@@ -1624,8 +1624,7 @@ static CLOSURE_CALLBACK(journal_write_done)
        } else {
                bch2_devlist_to_replicas(&replicas.e, BCH_DATA_journal,
                                         w->devs_written);
-               if (bch2_mark_replicas(c, &replicas.e))
-                       err = -EIO;
+               err = bch2_mark_replicas(c, &replicas.e);
        }
 
        if (err)
@@ -1988,7 +1987,7 @@ static int bch2_journal_write_pick_flush(struct journal *j, struct journal_buf *
         * write anything at all.
         */
        if (error && test_bit(JOURNAL_need_flush_write, &j->flags))
-               return -EIO;
+               return error;
 
        if (error ||
            w->noflush ||