summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/subvolume.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-06-20 13:49:25 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:04 -0400
commit1bb3c2a9747c404d23012088fbefb4499b884415 (patch)
tree450da8adf0cea75a7dda044f4c4b7c3d413c9da0 /fs/bcachefs/subvolume.c
parenta83e108fc1964b8273c6f51cc62588ee774a5a48 (diff)
downloadlinux-1bb3c2a9747c404d23012088fbefb4499b884415.tar.gz
linux-1bb3c2a9747c404d23012088fbefb4499b884415.tar.bz2
linux-1bb3c2a9747c404d23012088fbefb4499b884415.zip
bcachefs: New error message helpers
Add two new helpers for printing error messages with __func__ and bch2_err_str(): - bch_err_fn - bch_err_msg Also kill the old error strings in the recovery path, which were causing us to incorrectly report memory allocation failures - they're not needed anymore. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/subvolume.c')
-rw-r--r--fs/bcachefs/subvolume.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c
index 4b6631c229ee..828644e6c714 100644
--- a/fs/bcachefs/subvolume.c
+++ b/fs/bcachefs/subvolume.c
@@ -623,7 +623,7 @@ int bch2_fs_check_snapshots(struct bch_fs *c)
NULL, NULL, BTREE_INSERT_LAZY_RW|BTREE_INSERT_NOFAIL,
check_snapshot(&trans, &iter, k)));
if (ret)
- bch_err(c, "%s: error %s", __func__, bch2_err_str(ret));
+ bch_err_fn(c, ret);
return ret;
}
@@ -702,8 +702,7 @@ int bch2_fs_check_subvols(struct bch_fs *c)
NULL, NULL, BTREE_INSERT_LAZY_RW|BTREE_INSERT_NOFAIL,
check_subvol(&trans, &iter, k)));
if (ret)
- bch_err(c, "%s: error %s", __func__, bch2_err_str(ret));
-
+ bch_err_fn(c, ret);
return ret;
}
@@ -724,7 +723,7 @@ int bch2_fs_snapshots_start(struct bch_fs *c)
bch2_mark_snapshot(&trans, BTREE_ID_snapshots, 0, bkey_s_c_null, k, 0) ?:
bch2_snapshot_set_equiv(&trans, k)));
if (ret)
- bch_err(c, "error starting snapshots: %s", bch2_err_str(ret));
+ bch_err_fn(c, ret);
return ret;
}
@@ -1123,6 +1122,8 @@ int bch2_delete_dead_snapshots(struct bch_fs *c)
err:
darray_exit(&deleted);
bch2_trans_exit(&trans);
+ if (ret)
+ bch_err_fn(c, ret);
return ret;
}