#define bch_err_fn(_c, _ret) \
bch_err(_c, "%s(): error %s", __func__, bch2_err_str(_ret))
-#define bch_err_msg(_c, _ret, _msg) \
- bch_err(_c, "%s(): error " _msg " %s", __func__, bch2_err_str(_ret))
+#define bch_err_msg(_c, _ret, _msg, ...) \
+ bch_err(_c, "%s(): error " _msg " %s", __func__, ##__VA_ARGS__, bch2_err_str(_ret))
#define bch_verbose(c, fmt, ...) \
do { \
if (ret) {
iget_failed(&inode->v);
- return ERR_PTR(ret);
+ return ERR_PTR(bch2_err_class(ret));
}
mutex_lock(&c->vfs_inodes_lock);
{
struct bch_inode_info *inode = file_bch_inode(file);
struct bch_fs *c = inode->v.i_sb->s_fs_info;
+ int ret;
if (!dir_emit_dots(file, ctx))
return 0;
- return bch2_readdir(c, inode_inum(inode), ctx);
+ ret = bch2_readdir(c, inode_inum(inode), ctx);
+ if (ret)
+ bch_err_fn(c, ret);
+
+ return bch2_err_class(ret);
}
static const struct file_operations bch_file_operations = {
return 0;
err:
bch2_trans_iter_exit(trans, iter);
+ if (!bch2_err_matches(ret, BCH_ERR_transaction_restart))
+ bch_err_msg(trans->c, ret, "looking up inum %u:%llu:", inum.subvol, inum.inum);
return ret;
}