mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Don't use dmu_buf_is_dirty() for unassigned transaction.
The dmu_buf_is_dirty() call doesn't make sense here for two reasons: 1. txg is 0 for unassigned tx, so it was a no-op. 2. It is equivalent of checking if we have dirty records and we are doing this few lines earlier. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net> Closes #14825
This commit is contained in:
committed by
Brian Behlendorf
parent
bd8c6bd66f
commit
d0d91f185e
@@ -1246,16 +1246,10 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Start a transaction.
|
||||
*/
|
||||
tx = dmu_tx_create(outos);
|
||||
|
||||
nbps = maxblocks;
|
||||
error = dmu_read_l0_bps(inos, inzp->z_id, inoff, size, tx, bps,
|
||||
error = dmu_read_l0_bps(inos, inzp->z_id, inoff, size, bps,
|
||||
&nbps);
|
||||
if (error != 0) {
|
||||
dmu_tx_abort(tx);
|
||||
/*
|
||||
* If we are tyring to clone a block that was created
|
||||
* in the current transaction group. Return an error,
|
||||
@@ -1276,12 +1270,15 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
|
||||
*/
|
||||
if (BP_IS_PROTECTED(&bps[0])) {
|
||||
if (inzfsvfs != outzfsvfs) {
|
||||
dmu_tx_abort(tx);
|
||||
error = SET_ERROR(EXDEV);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Start a transaction.
|
||||
*/
|
||||
tx = dmu_tx_create(outos);
|
||||
dmu_tx_hold_sa(tx, outzp->z_sa_hdl, B_FALSE);
|
||||
db = (dmu_buf_impl_t *)sa_get_db(outzp->z_sa_hdl);
|
||||
DB_DNODE_ENTER(db);
|
||||
|
||||
Reference in New Issue
Block a user