ret = bch2_inode_unpack(k, inode);
err:
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_msg(trans->c, ret, "fetching inode %llu", inode_nr);
+ bch_err_msg(trans->c, ret, "fetching inode %llu", inode_nr);
bch2_trans_iter_exit(trans, &iter);
return ret;
}
if (!ret)
*snapshot = iter.pos.snapshot;
err:
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_msg(trans->c, ret, "fetching inode %llu:%u", inode_nr, *snapshot);
+ bch_err_msg(trans->c, ret, "fetching inode %llu:%u", inode_nr, *snapshot);
bch2_trans_iter_exit(trans, &iter);
return ret;
}
BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE);
bch2_trans_iter_exit(trans, &iter);
err:
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
goto create_lostfound;
}
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
if (ret)
return ret;
lostfound, &lostfound_str,
0, 0, S_IFDIR|0700, 0, NULL, NULL,
(subvol_inum) { }, 0);
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_msg(c, ret, "creating lost+found");
+ bch_err_msg(c, ret, "creating lost+found");
return ret;
}
BTREE_INSERT_LAZY_RW|
BTREE_INSERT_NOFAIL,
__reattach_inode(trans, inode, inode_snapshot));
- if (ret) {
- bch_err_msg(trans->c, ret, "reattaching inode %llu", inode->bi_inum);
- return ret;
- }
-
+ bch_err_msg(trans->c, ret, "reattaching inode %llu", inode->bi_inum);
return ret;
}
(printbuf_reset(&buf),
bch2_bkey_val_to_text(&buf, c, hash_k), buf.buf))) {
ret = hash_redo_key(trans, desc, hash_info, k_iter, hash_k);
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
if (ret)
return ret;
ret = -BCH_ERR_transaction_restart_nested;
u.bi_flags &= ~BCH_INODE_I_SIZE_DIRTY|BCH_INODE_UNLINKED;
ret = __write_inode(trans, &u, iter->pos.snapshot);
- if (ret) {
- if (!bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_msg(c, ret, "in fsck updating inode");
+ bch_err_msg(c, ret, "in fsck updating inode");
+ if (ret)
return ret;
- }
if (!bpos_eq(new_min_pos, POS_MIN))
bch2_btree_iter_set_pos(iter, bpos_predecessor(new_min_pos));
bch2_fs_lazy_rw(c);
ret = bch2_inode_rm_snapshot(trans, u.bi_inum, iter->pos.snapshot);
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_msg(c, ret, "in fsck deleting inode");
+ bch_err_msg(c, ret, "in fsck deleting inode");
return ret;
}
iter->pos.snapshot),
POS(u.bi_inum, U64_MAX),
0, NULL);
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_msg(c, ret, "in fsck truncating inode");
+ bch_err_msg(c, ret, "in fsck truncating inode");
if (ret)
return ret;
sectors = bch2_count_inode_sectors(trans, u.bi_inum, iter->pos.snapshot);
if (sectors < 0) {
- bch_err_msg(c, sectors, "fsck recounting inode sectors");
+ bch_err_msg(c, sectors, "in fsck recounting inode sectors");
return sectors;
}
if (do_update) {
ret = __write_inode(trans, &u, iter->pos.snapshot);
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_msg(c, ret, "in fsck updating inode");
+ bch_err_msg(c, ret, "in fsck updating inode");
if (ret)
return ret;
}
err:
fsck_err:
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
snapshots_seen_exit(&s);
bch2_trans_put(trans);
- if (ret)
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
}
}
fsck_err:
- if (ret)
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret ?: trans_was_restarted(trans, restart_count);
}
err:
fsck_err:
printbuf_exit(&buf);
-
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
delete:
ret = bch2_btree_delete_at(trans, iter, BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE);
snapshots_seen_exit(&s);
bch2_trans_put(trans);
- if (ret)
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
}
}
fsck_err:
- if (ret)
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret ?: trans_was_restarted(trans, restart_count);
}
err:
fsck_err:
printbuf_exit(&buf);
-
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
err:
fsck_err:
printbuf_exit(&buf);
-
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
snapshots_seen_exit(&s);
inode_walker_exit(&dir);
inode_walker_exit(&target);
-
- if (ret)
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
ret = hash_check_key(trans, bch2_xattr_hash_desc, hash_info, iter, k);
fsck_err:
- if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
NULL, NULL,
BTREE_INSERT_LAZY_RW|BTREE_INSERT_NOFAIL,
check_xattr(trans, &iter, k, &hash_info, &inode)));
- if (ret)
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
BTREE_INSERT_LAZY_RW,
bch2_btree_insert_trans(trans, BTREE_ID_subvolumes,
&root_subvol.k_i, 0));
- if (ret) {
- bch_err_msg(c, ret, "writing root subvol");
+ bch_err_msg(c, ret, "writing root subvol");
+ if (ret)
goto err;
- }
}
root_inode.bi_inum = inum;
ret = __write_inode(trans, &root_inode, snapshot);
- if (ret)
- bch_err_msg(c, ret, "writing root inode");
+ bch_err_msg(c, ret, "writing root inode");
}
err:
fsck_err:
BTREE_INSERT_NOFAIL|
BTREE_INSERT_LAZY_RW,
check_root_trans(trans));
-
- if (ret)
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
}
}
fsck_err:
- if (ret)
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
bch2_trans_iter_exit(trans, &iter);
bch2_trans_put(trans);
darray_exit(&path);
-
- if (ret)
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
} while (next_iter_range_start != U64_MAX);
kvfree(links.d);
-
- if (ret)
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}
BTREE_ITER_ALL_SNAPSHOTS, k,
NULL, NULL, BTREE_INSERT_NOFAIL|BTREE_INSERT_LAZY_RW,
fix_reflink_p_key(trans, &iter, k)));
- if (ret)
- bch_err_fn(c, ret);
+ bch_err_fn(c, ret);
return ret;
}