summaryrefslogtreecommitdiff
path: root/fs/bcachefs/movinggc.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-07-18 19:42:58 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:36 -0400
commitd4bf5eecd78a90d019b933929a14c91d6d41af62 (patch)
tree97fb2cc218d2831c2e6f2993605239969c883638 /fs/bcachefs/movinggc.c
parent615f867c14b2d70efb02dafb8e668d984e74d0e3 (diff)
bcachefs: Use bch2_err_str() in error messages
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/movinggc.c')
-rw-r--r--fs/bcachefs/movinggc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c
index 49fb405c1430..438ea22ad5bd 100644
--- a/fs/bcachefs/movinggc.c
+++ b/fs/bcachefs/movinggc.c
@@ -13,6 +13,7 @@
#include "buckets.h"
#include "clock.h"
#include "disk_groups.h"
+#include "errcode.h"
#include "error.h"
#include "extents.h"
#include "eytzinger.h"
@@ -319,7 +320,7 @@ static int bch2_copygc(struct bch_fs *c)
false,
copygc_pred, NULL);
if (ret < 0)
- bch_err(c, "error %i from bch2_move_data() in copygc", ret);
+ bch_err(c, "error from bch2_move_data() in copygc: %s", bch2_err_str(ret));
if (ret)
return ret;
@@ -427,6 +428,7 @@ void bch2_copygc_stop(struct bch_fs *c)
int bch2_copygc_start(struct bch_fs *c)
{
struct task_struct *t;
+ int ret;
if (c->copygc_thread)
return 0;
@@ -438,9 +440,10 @@ int bch2_copygc_start(struct bch_fs *c)
return -ENOMEM;
t = kthread_create(bch2_copygc_thread, c, "bch-copygc/%s", c->name);
- if (IS_ERR(t)) {
- bch_err(c, "error creating copygc thread: %li", PTR_ERR(t));
- return PTR_ERR(t);
+ ret = PTR_ERR_OR_ZERO(t);
+ if (ret) {
+ bch_err(c, "error creating copygc thread: %s", bch2_err_str(ret));
+ return ret;
}
get_task_struct(t);