Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
d4bf5eec
Commit
d4bf5eec
authored
Jul 18, 2022
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Use bch2_err_str() in error messages
Signed-off-by:
Kent Overstreet
<
kent.overstreet@gmail.com
>
parent
615f867c
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
149 additions
and
123 deletions
+149
-123
fs/bcachefs/alloc_background.c
fs/bcachefs/alloc_background.c
+2
-2
fs/bcachefs/btree_gc.c
fs/bcachefs/btree_gc.c
+18
-17
fs/bcachefs/checksum.c
fs/bcachefs/checksum.c
+18
-13
fs/bcachefs/ec.c
fs/bcachefs/ec.c
+2
-1
fs/bcachefs/fs.c
fs/bcachefs/fs.c
+4
-4
fs/bcachefs/fsck.c
fs/bcachefs/fsck.c
+32
-29
fs/bcachefs/journal_reclaim.c
fs/bcachefs/journal_reclaim.c
+6
-3
fs/bcachefs/migrate.c
fs/bcachefs/migrate.c
+3
-1
fs/bcachefs/move.c
fs/bcachefs/move.c
+2
-1
fs/bcachefs/movinggc.c
fs/bcachefs/movinggc.c
+7
-4
fs/bcachefs/quota.c
fs/bcachefs/quota.c
+2
-1
fs/bcachefs/rebalance.c
fs/bcachefs/rebalance.c
+6
-3
fs/bcachefs/recovery.c
fs/bcachefs/recovery.c
+3
-2
fs/bcachefs/subvolume.c
fs/bcachefs/subvolume.c
+12
-11
fs/bcachefs/super.c
fs/bcachefs/super.c
+11
-10
fs/bcachefs/tests.c
fs/bcachefs/tests.c
+21
-21
No files found.
fs/bcachefs/alloc_background.c
View file @
d4bf5eec
...
...
@@ -464,7 +464,7 @@ int bch2_alloc_read(struct bch_fs *c)
bch2_trans_exit
(
&
trans
);
if
(
ret
)
bch_err
(
c
,
"error reading alloc info: %
i"
,
ret
);
bch_err
(
c
,
"error reading alloc info: %
s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -1211,7 +1211,7 @@ static int bch2_dev_freespace_init(struct bch_fs *c, struct bch_dev *ca)
bch2_trans_exit
(
&
trans
);
if
(
ret
<
0
)
{
bch_err
(
ca
,
"error initializing free space: %
i"
,
ret
);
bch_err
(
ca
,
"error initializing free space: %
s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
fs/bcachefs/btree_gc.c
View file @
d4bf5eec
...
...
@@ -402,8 +402,8 @@ static int bch2_btree_repair_topology_recurse(struct bch_fs *c, struct btree *b)
}
if
(
ret
)
{
bch_err
(
c
,
"%s: error
%i getting btree node
"
,
__func__
,
ret
);
bch_err
(
c
,
"%s: error
getting btree node: %s
"
,
__func__
,
bch2_err_str
(
ret
)
);
break
;
}
...
...
@@ -471,8 +471,8 @@ static int bch2_btree_repair_topology_recurse(struct bch_fs *c, struct btree *b)
ret
=
PTR_ERR_OR_ZERO
(
cur
);
if
(
ret
)
{
bch_err
(
c
,
"%s: error
%i getting btree node
"
,
__func__
,
ret
);
bch_err
(
c
,
"%s: error
getting btree node: %s
"
,
__func__
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -804,7 +804,7 @@ static int bch2_gc_mark_key(struct btree_trans *trans, enum btree_id btree_id,
fsck_err:
err:
if
(
ret
)
bch_err
(
c
,
"
%s: ret %i"
,
__func__
,
ret
);
bch_err
(
c
,
"
error from %s(): %s"
,
__func__
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -910,7 +910,8 @@ static int bch2_gc_btree_init_recurse(struct btree_trans *trans, struct btree *b
ret
=
bch2_gc_mark_key
(
trans
,
b
->
c
.
btree_id
,
b
->
c
.
level
,
false
,
&
k
,
true
);
if
(
ret
)
{
bch_err
(
c
,
"%s: error %i from bch2_gc_mark_key"
,
__func__
,
ret
);
bch_err
(
c
,
"%s: error from bch2_gc_mark_key: %s"
,
__func__
,
bch2_err_str
(
ret
));
goto
fsck_err
;
}
...
...
@@ -970,8 +971,8 @@ static int bch2_gc_btree_init_recurse(struct btree_trans *trans, struct btree *b
continue
;
}
}
else
if
(
ret
)
{
bch_err
(
c
,
"%s: error
%i getting btree node
"
,
__func__
,
ret
);
bch_err
(
c
,
"%s: error
getting btree node: %s
"
,
__func__
,
bch2_err_str
(
ret
)
);
break
;
}
...
...
@@ -1038,7 +1039,7 @@ static int bch2_gc_btree_init(struct btree_trans *trans,
six_unlock_read
(
&
b
->
c
.
lock
);
if
(
ret
<
0
)
bch_err
(
c
,
"
%s: ret %i"
,
__func__
,
ret
);
bch_err
(
c
,
"
error from %s(): %s"
,
__func__
,
bch2_err_str
(
ret
)
);
printbuf_exit
(
&
buf
);
return
ret
;
}
...
...
@@ -1068,7 +1069,7 @@ static int bch2_gc_btrees(struct bch_fs *c, bool initial, bool metadata_only)
:
bch2_gc_btree
(
&
trans
,
ids
[
i
],
initial
,
metadata_only
);
if
(
ret
<
0
)
bch_err
(
c
,
"
%s: ret %i"
,
__func__
,
ret
);
bch_err
(
c
,
"
error from %s(): %s"
,
__func__
,
bch2_err_str
(
ret
)
);
bch2_trans_exit
(
&
trans
);
return
ret
;
...
...
@@ -1266,7 +1267,7 @@ static int bch2_gc_done(struct bch_fs *c,
if
(
ca
)
percpu_ref_put
(
&
ca
->
ref
);
if
(
ret
)
bch_err
(
c
,
"
%s: ret %i"
,
__func__
,
ret
);
bch_err
(
c
,
"
error from %s(): %s"
,
__func__
,
bch2_err_str
(
ret
)
);
percpu_up_write
(
&
c
->
mark_lock
);
printbuf_exit
(
&
buf
);
...
...
@@ -1433,7 +1434,7 @@ static int bch2_gc_alloc_done(struct bch_fs *c, bool metadata_only)
bch2_alloc_write_key
(
&
trans
,
&
iter
,
k
,
metadata_only
));
if
(
ret
<
0
)
{
bch_err
(
c
,
"error writing alloc info: %
i"
,
ret
);
bch_err
(
c
,
"error writing alloc info: %
s"
,
bch2_err_str
(
ret
)
);
percpu_ref_put
(
&
ca
->
ref
);
break
;
}
...
...
@@ -1497,7 +1498,7 @@ static int bch2_gc_alloc_start(struct bch_fs *c, bool metadata_only)
bch2_trans_exit
(
&
trans
);
if
(
ret
)
bch_err
(
c
,
"error reading alloc info at gc start: %
i"
,
ret
);
bch_err
(
c
,
"error reading alloc info at gc start: %
s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -1968,7 +1969,7 @@ int bch2_gc_gens(struct bch_fs *c)
BTREE_INSERT_NOFAIL
,
gc_btree_gens_key
(
&
trans
,
&
iter
,
k
));
if
(
ret
)
{
bch_err
(
c
,
"error recalculating oldest_gen: %
i"
,
ret
);
bch_err
(
c
,
"error recalculating oldest_gen: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
}
...
...
@@ -1981,7 +1982,7 @@ int bch2_gc_gens(struct bch_fs *c)
BTREE_INSERT_NOFAIL
,
bch2_alloc_write_oldest_gen
(
&
trans
,
&
iter
,
k
));
if
(
ret
)
{
bch_err
(
c
,
"error writing oldest_gen: %
i"
,
ret
);
bch_err
(
c
,
"error writing oldest_gen: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -2053,7 +2054,7 @@ static int bch2_gc_thread(void *arg)
ret
=
bch2_gc_gens
(
c
);
#endif
if
(
ret
<
0
)
bch_err
(
c
,
"btree gc failed: %
i"
,
ret
);
bch_err
(
c
,
"btree gc failed: %
s"
,
bch2_err_str
(
ret
)
);
debug_check_no_locks_held
();
}
...
...
@@ -2083,7 +2084,7 @@ int bch2_gc_thread_start(struct bch_fs *c)
p
=
kthread_create
(
bch2_gc_thread
,
c
,
"bch-gc/%s"
,
c
->
name
);
if
(
IS_ERR
(
p
))
{
bch_err
(
c
,
"error creating gc thread: %
li"
,
PTR_ERR
(
p
));
bch_err
(
c
,
"error creating gc thread: %
s"
,
bch2_err_str
(
PTR_ERR
(
p
)
));
return
PTR_ERR
(
p
);
}
...
...
fs/bcachefs/checksum.c
View file @
d4bf5eec
// SPDX-License-Identifier: GPL-2.0
#include "bcachefs.h"
#include "checksum.h"
#include "errcode.h"
#include "super.h"
#include "super-io.h"
...
...
@@ -527,7 +528,7 @@ int bch2_decrypt_sb_key(struct bch_fs *c,
ret
=
bch2_request_key
(
c
->
disk_sb
.
sb
,
&
user_key
);
if
(
ret
)
{
bch_err
(
c
,
"error requesting encryption key: %
i"
,
ret
);
bch_err
(
c
,
"error requesting encryption key: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -552,20 +553,24 @@ int bch2_decrypt_sb_key(struct bch_fs *c,
static
int
bch2_alloc_ciphers
(
struct
bch_fs
*
c
)
{
int
ret
;
if
(
!
c
->
chacha20
)
c
->
chacha20
=
crypto_alloc_sync_skcipher
(
"chacha20"
,
0
,
0
);
if
(
IS_ERR
(
c
->
chacha20
))
{
bch_err
(
c
,
"error requesting chacha20 module: %li"
,
PTR_ERR
(
c
->
chacha20
));
return
PTR_ERR
(
c
->
chacha20
);
ret
=
PTR_ERR_OR_ZERO
(
c
->
chacha20
);
if
(
ret
)
{
bch_err
(
c
,
"error requesting chacha20 module: %s"
,
bch2_err_str
(
ret
));
return
ret
;
}
if
(
!
c
->
poly1305
)
c
->
poly1305
=
crypto_alloc_shash
(
"poly1305"
,
0
,
0
);
if
(
IS_ERR
(
c
->
poly1305
))
{
bch_err
(
c
,
"error requesting poly1305 module: %li"
,
PTR_ERR
(
c
->
poly1305
));
return
PTR_ERR
(
c
->
poly1305
);
ret
=
PTR_ERR_OR_ZERO
(
c
->
poly1305
);
if
(
ret
)
{
bch_err
(
c
,
"error requesting poly1305 module: %s"
,
bch2_err_str
(
ret
));
return
ret
;
}
return
0
;
...
...
@@ -626,7 +631,7 @@ int bch2_enable_encryption(struct bch_fs *c, bool keyed)
if
(
keyed
)
{
ret
=
bch2_request_key
(
c
->
disk_sb
.
sb
,
&
user_key
);
if
(
ret
)
{
bch_err
(
c
,
"error requesting encryption key: %
i"
,
ret
);
bch_err
(
c
,
"error requesting encryption key: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -678,9 +683,9 @@ int bch2_fs_encryption_init(struct bch_fs *c)
pr_verbose_init
(
c
->
opts
,
""
);
c
->
sha256
=
crypto_alloc_shash
(
"sha256"
,
0
,
0
);
if
(
IS_ERR
(
c
->
sha256
))
{
bch_err
(
c
,
"error requesting sha256 module"
);
ret
=
PTR_ERR
(
c
->
sha256
);
ret
=
PTR_ERR_OR_ZERO
(
c
->
sha256
);
if
(
ret
)
{
bch_err
(
c
,
"error requesting sha256 module: %s"
,
bch2_err_str
(
ret
)
);
goto
out
;
}
...
...
fs/bcachefs/ec.c
View file @
d4bf5eec
...
...
@@ -949,7 +949,8 @@ static void ec_stripe_create(struct ec_stripe_new *s)
for_each_keylist_key
(
&
s
->
keys
,
k
)
{
ret
=
ec_stripe_update_extents
(
c
,
&
s
->
new_stripe
,
&
k
->
k
);
if
(
ret
)
{
bch_err
(
c
,
"error creating stripe: error %i updating pointers"
,
ret
);
bch_err
(
c
,
"error creating stripe: error updating pointers: %s"
,
bch2_err_str
(
ret
));
break
;
}
}
...
...
fs/bcachefs/fs.c
View file @
d4bf5eec
...
...
@@ -8,6 +8,7 @@
#include "buckets.h"
#include "chardev.h"
#include "dirent.h"
#include "errcode.h"
#include "extents.h"
#include "fs.h"
#include "fs-common.h"
...
...
@@ -1871,10 +1872,9 @@ static struct dentry *bch2_mount(struct file_system_type *fs_type,
sb
->
s_shrink
.
seeks
=
0
;
vinode
=
bch2_vfs_inode_get
(
c
,
BCACHEFS_ROOT_SUBVOL_INUM
);
if
(
IS_ERR
(
vinode
))
{
bch_err
(
c
,
"error mounting: error getting root inode %i"
,
(
int
)
PTR_ERR
(
vinode
));
ret
=
PTR_ERR
(
vinode
);
ret
=
PTR_ERR_OR_ZERO
(
vinode
);
if
(
ret
)
{
bch_err
(
c
,
"error mounting: error getting root inode: %s"
,
bch2_err_str
(
ret
));
goto
err_put_super
;
}
...
...
fs/bcachefs/fsck.c
View file @
d4bf5eec
...
...
@@ -137,8 +137,8 @@ static int lookup_first_inode(struct btree_trans *trans, u64 inode_nr,
ret
=
bch2_inode_unpack
(
k
,
inode
);
err:
if
(
ret
&&
ret
!=
-
EINTR
)
bch_err
(
trans
->
c
,
"error
%i fetching inode %llu
"
,
ret
,
inode_nr
);
bch_err
(
trans
->
c
,
"error
fetching inode %llu: %s
"
,
inode_nr
,
bch2_err_str
(
ret
)
);
bch2_trans_iter_exit
(
trans
,
&
iter
);
return
ret
;
}
...
...
@@ -165,8 +165,8 @@ static int __lookup_inode(struct btree_trans *trans, u64 inode_nr,
*
snapshot
=
iter
.
pos
.
snapshot
;
err:
if
(
ret
&&
ret
!=
-
EINTR
)
bch_err
(
trans
->
c
,
"error
%i fetching inode %llu:%u
"
,
ret
,
inode_nr
,
*
snapshot
);
bch_err
(
trans
->
c
,
"error
fetching inode %llu:%u: %s
"
,
inode_nr
,
*
snapshot
,
bch2_err_str
(
ret
)
);
bch2_trans_iter_exit
(
trans
,
&
iter
);
return
ret
;
}
...
...
@@ -225,7 +225,8 @@ static int write_inode(struct btree_trans *trans,
BTREE_INSERT_LAZY_RW
,
__write_inode
(
trans
,
inode
,
snapshot
));
if
(
ret
)
bch_err
(
trans
->
c
,
"error in fsck: error %i updating inode"
,
ret
);
bch_err
(
trans
->
c
,
"error in fsck: error updating inode: %s"
,
bch2_err_str
(
ret
));
return
ret
;
}
...
...
@@ -314,7 +315,7 @@ static int __remove_dirent(struct btree_trans *trans, struct bpos pos)
bch2_trans_iter_exit
(
trans
,
&
iter
);
err:
if
(
ret
&&
ret
!=
-
EINTR
)
bch_err
(
c
,
"error
%i from __remove_dirent()"
,
ret
);
bch_err
(
c
,
"error
from __remove_dirent(): %s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -350,7 +351,7 @@ static int lookup_lostfound(struct btree_trans *trans, u32 subvol,
}
if
(
ret
&&
ret
!=
-
EINTR
)
bch_err
(
c
,
"error looking up lost+found: %
i"
,
ret
);
bch_err
(
c
,
"error looking up lost+found: %
s"
,
bch2_err_str
(
ret
)
);
if
(
ret
)
return
ret
;
...
...
@@ -373,7 +374,7 @@ static int lookup_lostfound(struct btree_trans *trans, u32 subvol,
0
,
0
,
S_IFDIR
|
0700
,
0
,
NULL
,
NULL
,
(
subvol_inum
)
{
},
0
);
if
(
ret
&&
ret
!=
-
EINTR
)
bch_err
(
c
,
"error creating lost+found: %
i"
,
ret
);
bch_err
(
c
,
"error creating lost+found: %
s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -437,8 +438,8 @@ static int reattach_inode(struct btree_trans *trans,
BTREE_INSERT_NOFAIL
,
__reattach_inode
(
trans
,
inode
,
inode_snapshot
));
if
(
ret
)
{
bch_err
(
trans
->
c
,
"error
%i reattaching inode %llu
"
,
ret
,
inode
->
bi_inum
);
bch_err
(
trans
->
c
,
"error
reattaching inode %llu: %s
"
,
inode
->
bi_inum
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -910,7 +911,8 @@ static int check_inode(struct btree_trans *trans,
ret
=
fsck_inode_rm
(
trans
,
u
.
bi_inum
,
iter
->
pos
.
snapshot
);
if
(
ret
)
bch_err
(
c
,
"error in fsck: error %i while deleting inode"
,
ret
);
bch_err
(
c
,
"error in fsck: error while deleting inode: %s"
,
bch2_err_str
(
ret
));
return
ret
;
}
...
...
@@ -933,7 +935,8 @@ static int check_inode(struct btree_trans *trans,
POS
(
u
.
bi_inum
,
U64_MAX
),
0
,
NULL
);
if
(
ret
)
{
bch_err
(
c
,
"error in fsck: error %i truncating inode"
,
ret
);
bch_err
(
c
,
"error in fsck: error truncating inode: %s"
,
bch2_err_str
(
ret
));
return
ret
;
}
...
...
@@ -958,8 +961,8 @@ static int check_inode(struct btree_trans *trans,
sectors
=
bch2_count_inode_sectors
(
trans
,
u
.
bi_inum
,
iter
->
pos
.
snapshot
);
if
(
sectors
<
0
)
{
bch_err
(
c
,
"error in fsck: error
%i recounting inode sector
s"
,
(
int
)
sectors
);
bch_err
(
c
,
"error in fsck: error
recounting inode sectors: %
s"
,
bch2_err_str
(
sectors
)
);
return
sectors
;
}
...
...
@@ -978,13 +981,13 @@ static int check_inode(struct btree_trans *trans,
if
(
do_update
)
{
ret
=
__write_inode
(
trans
,
&
u
,
iter
->
pos
.
snapshot
);
if
(
ret
)
bch_err
(
c
,
"error in fsck: error
%i "
"updating inode"
,
ret
);
bch_err
(
c
,
"error in fsck: error
updating inode: %s"
,
bch2_err_str
(
ret
)
);
}
err:
fsck_err:
if
(
ret
)
bch_err
(
c
,
"error
%i from check_inode()"
,
ret
);
bch_err
(
c
,
"error
from check_inode(): %s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -1010,7 +1013,7 @@ static int check_inodes(struct bch_fs *c, bool full)
bch2_trans_exit
(
&
trans
);
snapshots_seen_exit
(
&
s
);
if
(
ret
)
bch_err
(
c
,
"error
%i from check_inodes()"
,
ret
);
bch_err
(
c
,
"error
from check_inodes(): %s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -1145,7 +1148,7 @@ static int check_i_sectors(struct btree_trans *trans, struct inode_walker *w)
}
fsck_err:
if
(
ret
)
bch_err
(
c
,
"error
%i from check_i_sectors()"
,
ret
);
bch_err
(
c
,
"error
from check_i_sectors(): %s"
,
bch2_err_str
(
ret
)
);
return
ret
?:
ret2
;
}
...
...
@@ -1327,7 +1330,7 @@ static int check_extents(struct bch_fs *c)
snapshots_seen_exit
(
&
s
);
if
(
ret
)
bch_err
(
c
,
"error
%i from check_extents()"
,
ret
);
bch_err
(
c
,
"error
from check_extents(): %s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -1366,7 +1369,7 @@ static int check_subdir_count(struct btree_trans *trans, struct inode_walker *w)
}
fsck_err:
if
(
ret
)
bch_err
(
c
,
"error
%i from check_subdir_count()"
,
ret
);
bch_err
(
c
,
"error
from check_subdir_count(): %s"
,
bch2_err_str
(
ret
)
);
return
ret
?:
ret2
;
}
...
...
@@ -1485,7 +1488,7 @@ static int check_dirent_target(struct btree_trans *trans,
printbuf_exit
(
&
buf
);
if
(
ret
&&
ret
!=
-
EINTR
)
bch_err
(
c
,
"error
%i from check_target()"
,
ret
);
bch_err
(
c
,
"error
from check_target(): %s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -1658,7 +1661,7 @@ static int check_dirent(struct btree_trans *trans, struct btree_iter *iter,
printbuf_exit
(
&
buf
);
if
(
ret
&&
ret
!=
-
EINTR
)
bch_err
(
c
,
"error
%i from check_dirent()"
,
ret
);
bch_err
(
c
,
"error
from check_dirent(): %s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -1697,7 +1700,7 @@ static int check_dirents(struct bch_fs *c)
inode_walker_exit
(
&
target
);
if
(
ret
)
bch_err
(
c
,
"error
%i from check_dirents()"
,
ret
);
bch_err
(
c
,
"error
from check_dirents(): %s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -1733,7 +1736,7 @@ static int check_xattr(struct btree_trans *trans, struct btree_iter *iter,
ret
=
hash_check_key
(
trans
,
bch2_xattr_hash_desc
,
hash_info
,
iter
,
k
);
fsck_err:
if
(
ret
&&
ret
!=
-
EINTR
)
bch_err
(
c
,
"error
%i from check_xattr()"
,
ret
);
bch_err
(
c
,
"error
from check_xattr(): %s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -1765,7 +1768,7 @@ static int check_xattrs(struct bch_fs *c)
bch2_trans_exit
(
&
trans
);
if
(
ret
)
bch_err
(
c
,
"error
%i from check_xattrs()"
,
ret
);
bch_err
(
c
,
"error
from check_xattrs(): %s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -1797,7 +1800,7 @@ static int check_root_trans(struct btree_trans *trans)
BTREE_INSERT_LAZY_RW
,
__bch2_btree_insert
(
trans
,
BTREE_ID_subvolumes
,
&
root_subvol
.
k_i
));
if
(
ret
)
{
bch_err
(
c
,
"error writing root subvol: %
i"
,
ret
);
bch_err
(
c
,
"error writing root subvol: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -1816,7 +1819,7 @@ static int check_root_trans(struct btree_trans *trans)
ret
=
__write_inode
(
trans
,
&
root_inode
,
snapshot
);
if
(
ret
)
bch_err
(
c
,
"error writing root inode: %
i"
,
ret
);
bch_err
(
c
,
"error writing root inode: %
s"
,
bch2_err_str
(
ret
)
);
}
err:
fsck_err:
...
...
@@ -1969,7 +1972,7 @@ static int check_path(struct btree_trans *trans,
}
fsck_err:
if
(
ret
)
bch_err
(
c
,
"%s: err %
i"
,
__func__
,
ret
);
bch_err
(
c
,
"%s: err %
s"
,
__func__
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
fs/bcachefs/journal_reclaim.c
View file @
d4bf5eec
...
...
@@ -2,6 +2,7 @@
#include "bcachefs.h"
#include "btree_key_cache.h"
#include "errcode.h"
#include "error.h"
#include "journal.h"
#include "journal_io.h"
...
...
@@ -741,15 +742,17 @@ int bch2_journal_reclaim_start(struct journal *j)
{
struct
bch_fs
*
c
=
container_of
(
j
,
struct
bch_fs
,
journal
);
struct
task_struct
*
p
;
int
ret
;
if
(
j
->
reclaim_thread
)
return
0
;
p
=
kthread_create
(
bch2_journal_reclaim_thread
,
j
,
"bch-reclaim/%s"
,
c
->
name
);
if
(
IS_ERR
(
p
))
{
bch_err
(
c
,
"error creating journal reclaim thread: %li"
,
PTR_ERR
(
p
));
return
PTR_ERR
(
p
);
ret
=
PTR_ERR_OR_ZERO
(
p
);
if
(
ret
)
{
bch_err
(
c
,
"error creating journal reclaim thread: %s"
,
bch2_err_str
(
ret
));
return
ret
;
}
get_task_struct
(
p
);
...
...
fs/bcachefs/migrate.c
View file @
d4bf5eec
...
...
@@ -8,6 +8,7 @@
#include "btree_update.h"
#include "btree_update_interior.h"
#include "buckets.h"
#include "errcode.h"
#include "extents.h"
#include "io.h"
#include "journal.h"
...
...
@@ -151,7 +152,8 @@ static int bch2_dev_metadata_drop(struct bch_fs *c, unsigned dev_idx, int flags)
}
if
(
ret
)
{
bch_err
(
c
,
"Error updating btree node key: %i"
,
ret
);
bch_err
(
c
,
"Error updating btree node key: %s"
,
bch2_err_str
(
ret
));
break
;
}
next:
...
...
fs/bcachefs/move.c
View file @
d4bf5eec
...
...
@@ -8,6 +8,7 @@
#include "btree_update_interior.h"
#include "disk_groups.h"
#include "ec.h"
#include "errcode.h"
#include "inode.h"
#include "io.h"
#include "journal_reclaim.h"
...
...
@@ -564,7 +565,7 @@ static int bch2_move_btree(struct bch_fs *c,
bch2_trans_exit
(
&
trans
);
if
(
ret
)
bch_err
(
c
,
"error
%i in bch2_move_btree"
,
ret
);
bch_err
(
c
,
"error
in %s(): %s"
,
__func__
,
bch2_err_str
(
ret
)
);
bch2_btree_interior_updates_flush
(
c
);
...
...
fs/bcachefs/movinggc.c
View file @
d4bf5eec
...
...
@@ -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
);
...
...
fs/bcachefs/quota.c
View file @
d4bf5eec
// SPDX-License-Identifier: GPL-2.0
#include "bcachefs.h"
#include "btree_update.h"
#include "errcode.h"
#include "inode.h"
#include "quota.h"
#include "subvolume.h"
...
...
@@ -488,7 +489,7 @@ int bch2_fs_quota_read(struct bch_fs *c)
POS_MIN
,
BTREE_ITER_PREFETCH
|
BTREE_ITER_ALL_SNAPSHOTS
,
k
,
bch2_fs_quota_read_inode
(
&
trans
,
&
iter
,
k
));
if
(
ret
)
bch_err
(
c
,
"err in quota_read: %
i"
,
ret
);
bch_err
(
c
,
"err in quota_read: %
s"
,
bch2_err_str
(
ret
)
);
bch2_trans_exit
(
&
trans
);
return
ret
;
...
...
fs/bcachefs/rebalance.c
View file @
d4bf5eec
...
...
@@ -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"
...
...
@@ -332,6 +333,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
;
...
...
@@ -340,9 +342,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
);
...
...
fs/bcachefs/recovery.c
View file @
d4bf5eec
...
...
@@ -10,6 +10,7 @@
#include "buckets.h"
#include "dirent.h"
#include "ec.h"
#include "errcode.h"
#include "error.h"
#include "fs-common.h"
#include "fsck.h"
...
...
@@ -1419,9 +1420,9 @@ int bch2_fs_recovery(struct bch_fs *c)
}
if
(
ret
)
bch_err
(
c
,
"Error in recovery: %s (%
i)"
,
err
,
ret
);
bch_err
(
c
,
"Error in recovery: %s (%
s)"
,
err
,
bch2_err_str
(
ret
)
);
else
bch_verbose
(
c
,
"ret %
i"
,
ret
);
bch_verbose
(
c
,
"ret %
s"
,
bch2_err_str
(
ret
)
);
return
ret
;
err:
fsck_err:
...
...
fs/bcachefs/subvolume.c
View file @
d4bf5eec
...
...
@@ -3,6 +3,7 @@
#include "bcachefs.h"
#include "btree_key_cache.h"
#include "btree_update.h"
#include "errcode.h"
#include "error.h"
#include "fs.h"
#include "subvolume.h"
...
...
@@ -315,8 +316,8 @@ static int check_subvol(struct btree_trans *trans,
if
(
BCH_SUBVOLUME_UNLINKED
(
subvol
.
v
))
{
ret
=
bch2_subvolume_delete
(
trans
,
iter
->
pos
.
offset
);
if
(
ret
&&
ret
!=
-
EINTR
)
bch_err
(
trans
->
c
,
"error deleting subvolume %llu: %
i
"
,
iter
->
pos
.
offset
,
ret
);
bch_err
(
trans
->
c
,
"error deleting subvolume %llu: %
s
"
,
iter
->
pos
.
offset
,
bch2_err_str
(
ret
)
);
if
(
ret
)
return
ret
;
}
...
...
@@ -365,7 +366,7 @@ int bch2_fs_snapshots_start(struct bch_fs *c)
bch2_trans_exit
(
&
trans
);
if
(
ret
)
bch_err
(
c
,
"error starting snapshots: %
i"
,
ret
);
bch_err
(
c
,
"error starting snapshots: %
s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -647,7 +648,7 @@ int bch2_delete_dead_snapshots(struct bch_fs *c)
if
(
!
test_bit
(
BCH_FS_STARTED
,
&
c
->
flags
))
{
ret
=
bch2_fs_read_write_early
(
c
);
if
(
ret
)
{
bch_err
(
c
,
"error deleleting dead snapshots: error going rw: %
i"
,
ret
);
bch_err
(
c
,
"error deleleting dead snapshots: error going rw: %
s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
}
...
...
@@ -663,7 +664,7 @@ int bch2_delete_dead_snapshots(struct bch_fs *c)
NULL
,
NULL
,
0
,
bch2_delete_redundant_snapshot
(
&
trans
,
&
iter
,
k
));
if
(
ret
)
{
bch_err
(
c
,
"error deleting redundant snapshots: %
i"
,
ret
);
bch_err
(
c
,
"error deleting redundant snapshots: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -671,7 +672,7 @@ int bch2_delete_dead_snapshots(struct bch_fs *c)
POS_MIN
,
0
,
k
,
bch2_snapshot_set_equiv
(
&
trans
,
k
));
if
(
ret
)
{
bch_err
(
c
,
"error in bch2_snapshots_set_equiv: %
i"
,
ret
);
bch_err
(
c
,
"error in bch2_snapshots_set_equiv: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -690,7 +691,7 @@ int bch2_delete_dead_snapshots(struct bch_fs *c)
bch2_trans_iter_exit
(
&
trans
,
&
iter
);
if
(
ret
)
{
bch_err
(
c
,
"error walking snapshots: %
i"
,
ret
);
bch_err
(
c
,
"error walking snapshots: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -710,7 +711,7 @@ int bch2_delete_dead_snapshots(struct bch_fs *c)
darray_exit
(
&
equiv_seen
);
if
(
ret
)
{
bch_err
(
c
,
"error deleting snapshot keys: %
i"
,
ret
);
bch_err
(
c
,
"error deleting snapshot keys: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
}
...
...
@@ -719,8 +720,8 @@ int bch2_delete_dead_snapshots(struct bch_fs *c)
ret
=
commit_do
(
&
trans
,
NULL
,
NULL
,
0
,
bch2_snapshot_node_delete
(
&
trans
,
deleted
.
data
[
i
]));
if
(
ret
)
{
bch_err
(
c
,
"error deleting snapshot %u: %
i
"
,
deleted
.
data
[
i
],
ret
);
bch_err
(
c
,
"error deleting snapshot %u: %
s
"
,
deleted
.
data
[
i
],
bch2_err_str
(
ret
)
);
goto
err
;
}
}
...
...
@@ -912,7 +913,7 @@ void bch2_subvolume_wait_for_pagecache_and_delete(struct work_struct *work)
ret
=
bch2_trans_do
(
c
,
NULL
,
NULL
,
BTREE_INSERT_NOFAIL
,
bch2_subvolume_delete
(
&
trans
,
*
id
));
if
(
ret
)
{
bch_err
(
c
,
"error
%i deleting subvolume %u"
,
ret
,
*
id
);
bch_err
(
c
,
"error
deleting subvolume %u: %s"
,
*
id
,
bch2_err_str
(
ret
)
);
break
;
}
}
...
...
fs/bcachefs/super.c
View file @
d4bf5eec
...
...
@@ -25,6 +25,7 @@
#include "debug.h"
#include "disk_groups.h"
#include "ec.h"
#include "errcode.h"
#include "error.h"
#include "fs.h"
#include "fs-io.h"
...
...
@@ -1430,7 +1431,7 @@ static int bch2_dev_remove_alloc(struct bch_fs *c, struct bch_dev *ca)
bch2_btree_delete_range
(
c
,
BTREE_ID_alloc
,
start
,
end
,
BTREE_TRIGGER_NORUN
,
NULL
);
if
(
ret
)
bch_err
(
c
,
"error
%i removing dev alloc info"
,
ret
);
bch_err
(
c
,
"error
removing dev alloc info: %s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -1458,7 +1459,7 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags)
ret
=
bch2_dev_data_drop
(
c
,
ca
->
dev_idx
,
flags
);
if
(
ret
)
{
bch_err
(
ca
,
"Remove failed: error
%i dropping data"
,
ret
);
bch_err
(
ca
,
"Remove failed: error
dropping data: %s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -1470,7 +1471,7 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags)
ret
=
bch2_journal_flush_device_pins
(
&
c
->
journal
,
ca
->
dev_idx
);
if
(
ret
)
{
bch_err
(
ca
,
"Remove failed: error
%i flushing journal"
,
ret
);
bch_err
(
ca
,
"Remove failed: error
flushing journal: %s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -1482,7 +1483,7 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags)
ret
=
bch2_replicas_gc2
(
c
);
if
(
ret
)
{
bch_err
(
ca
,
"Remove failed: error
%i from replicas gc"
,
ret
);
bch_err
(
ca
,
"Remove failed: error
from replicas gc: %s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -1546,7 +1547,7 @@ int bch2_dev_add(struct bch_fs *c, const char *path)
ret
=
bch2_read_super
(
path
,
&
opts
,
&
sb
);
if
(
ret
)
{
bch_err
(
c
,
"device add error: error reading super: %
i"
,
ret
);
bch_err
(
c
,
"device add error: error reading super: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -1639,13 +1640,13 @@ int bch2_dev_add(struct bch_fs *c, const char *path)
ret
=
bch2_trans_mark_dev_sb
(
c
,
ca
);
if
(
ret
)
{
bch_err
(
c
,
"device add error: error marking new superblock: %
i"
,
ret
);
bch_err
(
c
,
"device add error: error marking new superblock: %
s"
,
bch2_err_str
(
ret
)
);
goto
err_late
;
}
ret
=
bch2_fs_freespace_init
(
c
);
if
(
ret
)
{
bch_err
(
c
,
"device add error: error initializing free space: %
i"
,
ret
);
bch_err
(
c
,
"device add error: error initializing free space: %
s"
,
bch2_err_str
(
ret
)
);
goto
err_late
;
}
...
...
@@ -1707,8 +1708,8 @@ int bch2_dev_online(struct bch_fs *c, const char *path)
ret
=
bch2_trans_mark_dev_sb
(
c
,
ca
);
if
(
ret
)
{
bch_err
(
c
,
"error bringing %s online: error
%i from bch2_trans_mark_dev_sb
"
,
path
,
ret
);
bch_err
(
c
,
"error bringing %s online: error
from bch2_trans_mark_dev_sb: %s
"
,
path
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -1777,7 +1778,7 @@ int bch2_dev_resize(struct bch_fs *c, struct bch_dev *ca, u64 nbuckets)
ret
=
bch2_dev_buckets_resize
(
c
,
ca
,
nbuckets
);
if
(
ret
)
{
bch_err
(
ca
,
"Resize error: %
i"
,
ret
);
bch_err
(
ca
,
"Resize error: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
fs/bcachefs/tests.c
View file @
d4bf5eec
...
...
@@ -46,7 +46,7 @@ static int test_delete(struct bch_fs *c, u64 nr)
bch2_btree_iter_traverse
(
&
iter
)
?:
bch2_trans_update
(
&
trans
,
&
iter
,
&
k
.
k_i
,
0
));
if
(
ret
)
{
bch_err
(
c
,
"update error in test_delete: %
i"
,
ret
);
bch_err
(
c
,
"update error in test_delete: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -55,7 +55,7 @@ static int test_delete(struct bch_fs *c, u64 nr)
bch2_btree_iter_traverse
(
&
iter
)
?:
bch2_btree_delete_at
(
&
trans
,
&
iter
,
0
));
if
(
ret
)
{
bch_err
(
c
,
"delete error (first) in test_delete: %
i"
,
ret
);
bch_err
(
c
,
"delete error (first) in test_delete: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -64,7 +64,7 @@ static int test_delete(struct bch_fs *c, u64 nr)
bch2_btree_iter_traverse
(
&
iter
)
?:
bch2_btree_delete_at
(
&
trans
,
&
iter
,
0
));
if
(
ret
)
{
bch_err
(
c
,
"delete error (second) in test_delete: %
i"
,
ret
);
bch_err
(
c
,
"delete error (second) in test_delete: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
err:
...
...
@@ -92,7 +92,7 @@ static int test_delete_written(struct bch_fs *c, u64 nr)
bch2_btree_iter_traverse
(
&
iter
)
?:
bch2_trans_update
(
&
trans
,
&
iter
,
&
k
.
k_i
,
0
));
if
(
ret
)
{
bch_err
(
c
,
"update error in test_delete_written: %
i"
,
ret
);
bch_err
(
c
,
"update error in test_delete_written: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
...
...
@@ -103,7 +103,7 @@ static int test_delete_written(struct bch_fs *c, u64 nr)
bch2_btree_iter_traverse
(
&
iter
)
?:
bch2_btree_delete_at
(
&
trans
,
&
iter
,
0
));
if
(
ret
)
{
bch_err
(
c
,
"delete error in test_delete_written: %
i"
,
ret
);
bch_err
(
c
,
"delete error in test_delete_written: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
err:
...
...
@@ -136,7 +136,7 @@ static int test_iterate(struct bch_fs *c, u64 nr)
ret
=
bch2_btree_insert
(
c
,
BTREE_ID_xattrs
,
&
k
.
k_i
,
NULL
,
NULL
,
0
);
if
(
ret
)
{
bch_err
(
c
,
"insert error in test_iterate: %
i"
,
ret
);
bch_err
(
c
,
"insert error in test_iterate: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
}
...
...
@@ -192,7 +192,7 @@ static int test_iterate_extents(struct bch_fs *c, u64 nr)
ret
=
bch2_btree_insert
(
c
,
BTREE_ID_extents
,
&
k
.
k_i
,
NULL
,
NULL
,
0
);
if
(
ret
)
{
bch_err
(
c
,
"insert error in test_iterate_extents: %
i"
,
ret
);
bch_err
(
c
,
"insert error in test_iterate_extents: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
}
...
...
@@ -247,7 +247,7 @@ static int test_iterate_slots(struct bch_fs *c, u64 nr)
ret
=
bch2_btree_insert
(
c
,
BTREE_ID_xattrs
,
&
k
.
k_i
,
NULL
,
NULL
,
0
);
if
(
ret
)
{
bch_err
(
c
,
"insert error in test_iterate_slots: %
i"
,
ret
);
bch_err
(
c
,
"insert error in test_iterate_slots: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
}
...
...
@@ -313,7 +313,7 @@ static int test_iterate_slots_extents(struct bch_fs *c, u64 nr)
ret
=
bch2_btree_insert
(
c
,
BTREE_ID_extents
,
&
k
.
k_i
,
NULL
,
NULL
,
0
);
if
(
ret
)
{
bch_err
(
c
,
"insert error in test_iterate_slots_extents: %
i"
,
ret
);
bch_err
(
c
,
"insert error in test_iterate_slots_extents: %
s"
,
bch2_err_str
(
ret
)
);
goto
err
;
}
}
...
...
@@ -419,7 +419,7 @@ static int insert_test_extent(struct bch_fs *c,
ret
=
bch2_btree_insert
(
c
,
BTREE_ID_extents
,
&
k
.
k_i
,
NULL
,
NULL
,
0
);
if
(
ret
)
bch_err
(
c
,
"insert error in insert_test_extent: %
i"
,
ret
);
bch_err
(
c
,
"insert error in insert_test_extent: %
s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -518,7 +518,7 @@ static int test_snapshots(struct bch_fs *c, u64 nr)
ret
=
test_snapshot_filter
(
c
,
snapids
[
0
],
snapids
[
1
]);
if
(
ret
)
{
bch_err
(
c
,
"err
%i from test_snapshot_filter"
,
ret
);
bch_err
(
c
,
"err
from test_snapshot_filter: %s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -555,7 +555,7 @@ static int rand_insert(struct bch_fs *c, u64 nr)
ret
=
commit_do
(
&
trans
,
NULL
,
NULL
,
0
,
__bch2_btree_insert
(
&
trans
,
BTREE_ID_xattrs
,
&
k
.
k_i
));
if
(
ret
)
{
bch_err
(
c
,
"error in rand_insert: %
i"
,
ret
);
bch_err
(
c
,
"error in rand_insert: %
s"
,
bch2_err_str
(
ret
)
);
break
;
}
}
...
...
@@ -591,7 +591,7 @@ static int rand_insert_multi(struct bch_fs *c, u64 nr)
__bch2_btree_insert
(
&
trans
,
BTREE_ID_xattrs
,
&
k
[
6
].
k_i
)
?:
__bch2_btree_insert
(
&
trans
,
BTREE_ID_xattrs
,
&
k
[
7
].
k_i
));
if
(
ret
)
{
bch_err
(
c
,
"error in rand_insert_multi: %
i"
,
ret
);
bch_err
(
c
,
"error in rand_insert_multi: %
s"
,
bch2_err_str
(
ret
)
);
break
;
}
}
...
...
@@ -618,7 +618,7 @@ static int rand_lookup(struct bch_fs *c, u64 nr)
k
=
bch2_btree_iter_peek
(
&
iter
);
ret
=
bkey_err
(
k
);
if
(
ret
)
{
bch_err
(
c
,
"error in rand_lookup: %
i"
,
ret
);
bch_err
(
c
,
"error in rand_lookup: %
s"
,
bch2_err_str
(
ret
)
);
break
;
}
}
...
...
@@ -641,7 +641,7 @@ static int rand_mixed_trans(struct btree_trans *trans,
k
=
bch2_btree_iter_peek
(
iter
);
ret
=
bkey_err
(
k
);
if
(
ret
&&
ret
!=
-
EINTR
)
bch_err
(
trans
->
c
,
"lookup error in rand_mixed: %
i"
,
ret
);
bch_err
(
trans
->
c
,
"lookup error in rand_mixed: %
s"
,
bch2_err_str
(
ret
)
);
if
(
ret
)
return
ret
;
...
...
@@ -671,7 +671,7 @@ static int rand_mixed(struct bch_fs *c, u64 nr)
ret
=
commit_do
(
&
trans
,
NULL
,
NULL
,
0
,
rand_mixed_trans
(
&
trans
,
&
iter
,
&
cookie
,
i
,
rand
));
if
(
ret
)
{
bch_err
(
c
,
"update error in rand_mixed: %
i"
,
ret
);
bch_err
(
c
,
"update error in rand_mixed: %
s"
,
bch2_err_str
(
ret
)
);
break
;
}
}
...
...
@@ -717,7 +717,7 @@ static int rand_delete(struct bch_fs *c, u64 nr)
ret
=
commit_do
(
&
trans
,
NULL
,
NULL
,
0
,
__do_delete
(
&
trans
,
pos
));
if
(
ret
)
{
bch_err
(
c
,
"error in rand_delete: %
i"
,
ret
);
bch_err
(
c
,
"error in rand_delete: %
s"
,
bch2_err_str
(
ret
)
);
break
;
}
}
...
...
@@ -747,7 +747,7 @@ static int seq_insert(struct bch_fs *c, u64 nr)
bch2_btree_iter_traverse
(
&
iter
)
?:
bch2_trans_update
(
&
trans
,
&
iter
,
&
insert
.
k_i
,
0
));
if
(
ret
)
{
bch_err
(
c
,
"error in seq_insert: %
i"
,
ret
);
bch_err
(
c
,
"error in seq_insert: %
s"
,
bch2_err_str
(
ret
)
);
break
;
}
...
...
@@ -798,7 +798,7 @@ static int seq_overwrite(struct bch_fs *c, u64 nr)
bch2_btree_iter_traverse
(
&
iter
)
?:
bch2_trans_update
(
&
trans
,
&
iter
,
&
u
.
k_i
,
0
));
if
(
ret
)
{
bch_err
(
c
,
"error in seq_overwrite: %
i"
,
ret
);
bch_err
(
c
,
"error in seq_overwrite: %
s"
,
bch2_err_str
(
ret
)
);
break
;
}
}
...
...
@@ -816,7 +816,7 @@ static int seq_delete(struct bch_fs *c, u64 nr)
SPOS
(
0
,
0
,
U32_MAX
),
SPOS_MAX
,
0
,
NULL
);
if
(
ret
)
bch_err
(
c
,
"error in seq_delete: %
i"
,
ret
);
bch_err
(
c
,
"error in seq_delete: %
s"
,
bch2_err_str
(
ret
)
);
return
ret
;
}
...
...
@@ -853,7 +853,7 @@ static int btree_perf_test_thread(void *data)
ret
=
j
->
fn
(
j
->
c
,
div64_u64
(
j
->
nr
,
j
->
nr_threads
));
if
(
ret
)
{
bch_err
(
j
->
c
,
"%ps: error %
i"
,
j
->
fn
,
ret
);
bch_err
(
j
->
c
,
"%ps: error %
s"
,
j
->
fn
,
bch2_err_str
(
ret
)
);
j
->
ret
=
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment