gentoo-overlay/sys-kernel/hardened-kernel/files/linux-6.12/0166-bcachefs-BCH_ERR_insuf...

55 lines
2.0 KiB
Diff

From fd2a164b5c5fd7b690cc98c313d0f1512e0d2647 Mon Sep 17 00:00:00 2001
From: Kent Overstreet <kent.overstreet@linux.dev>
Date: Wed, 4 Dec 2024 17:53:38 -0500
Subject: [PATCH 166/233] bcachefs: BCH_ERR_insufficient_journal_devices
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
kill another standard error code use
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Alexander Miroshnichenko <alex@millerson.name>
---
fs/bcachefs/errcode.h | 1 +
fs/bcachefs/journal_io.c | 5 ++---
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/bcachefs/errcode.h b/fs/bcachefs/errcode.h
index 47387f7d6202..5e4dd85ac669 100644
--- a/fs/bcachefs/errcode.h
+++ b/fs/bcachefs/errcode.h
@@ -263,6 +263,7 @@
x(EIO, missing_indirect_extent) \
x(EIO, invalidate_stripe_to_dev) \
x(EIO, no_encryption_key) \
+ x(EIO, insufficient_journal_devices) \
x(BCH_ERR_btree_node_read_err, btree_node_read_err_fixable) \
x(BCH_ERR_btree_node_read_err, btree_node_read_err_want_retry) \
x(BCH_ERR_btree_node_read_err, btree_node_read_err_must_retry) \
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c
index e7a43400a587..e5fce5e497f2 100644
--- a/fs/bcachefs/journal_io.c
+++ b/fs/bcachefs/journal_io.c
@@ -1503,8 +1503,7 @@ static int journal_write_alloc(struct journal *j, struct journal_buf *w)
devs_sorted = bch2_dev_alloc_list(c, &j->wp.stripe, &devs);
- __journal_write_alloc(j, w, &devs_sorted,
- sectors, &replicas, replicas_want);
+ __journal_write_alloc(j, w, &devs_sorted, sectors, &replicas, replicas_want);
if (replicas >= replicas_want)
goto done;
@@ -1544,7 +1543,7 @@ static int journal_write_alloc(struct journal *j, struct journal_buf *w)
BUG_ON(bkey_val_u64s(&w->key.k) > BCH_REPLICAS_MAX);
- return replicas >= replicas_need ? 0 : -EROFS;
+ return replicas >= replicas_need ? 0 : -BCH_ERR_insufficient_journal_devices;
}
static void journal_buf_realloc(struct journal *j, struct journal_buf *buf)
--
2.45.2