]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/rebalance.c
Update bcachefs sources to 90a9c61e2b bcachefs: Switch bch2_btree_delete_range()...
[bcachefs-tools-debian] / libbcachefs / rebalance.c
index 31da409338326abe280a9e41a5c6b89277128f28..ecc64dd92b05074b958bf9fe33255b12703b6929 100644 (file)
@@ -6,6 +6,7 @@
 #include "buckets.h"
 #include "clock.h"
 #include "disk_groups.h"
+#include "errcode.h"
 #include "extents.h"
 #include "io.h"
 #include "move.h"
@@ -331,6 +332,7 @@ void bch2_rebalance_stop(struct bch_fs *c)
 int bch2_rebalance_start(struct bch_fs *c)
 {
        struct task_struct *p;
+       int ret;
 
        if (c->rebalance.thread)
                return 0;
@@ -339,9 +341,10 @@ int bch2_rebalance_start(struct bch_fs *c)
                return 0;
 
        p = kthread_create(bch2_rebalance_thread, c, "bch-rebalance/%s", c->name);
-       if (IS_ERR(p)) {
-               bch_err(c, "error creating rebalance thread: %li", PTR_ERR(p));
-               return PTR_ERR(p);
+       ret = PTR_ERR_OR_ZERO(p);
+       if (ret) {
+               bch_err(c, "error creating rebalance thread: %s", bch2_err_str(ret));
+               return ret;
        }
 
        get_task_struct(p);