mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
btrfs-util: add assert to fix Coverity warning
Coverity gets confused since the iterator change, so add an
assert to indicate that this is allocated if n_old_groups is > 0
CID#1545922
Follow-up for 125cca1b51
This commit is contained in:
committed by
Luca Boccassi
parent
e603a438a7
commit
5e30e6e281
@@ -1187,6 +1187,8 @@ static int copy_quota_hierarchy(int fd, uint64_t old_subvol_id, uint64_t new_sub
|
||||
if (n_old_qgroups <= 0) /* Nothing to copy */
|
||||
return n_old_qgroups;
|
||||
|
||||
assert(old_qgroups); /* Coverity gets confused by the macro iterator allocating this, add a hint */
|
||||
|
||||
r = btrfs_subvol_get_parent(fd, old_subvol_id, &old_parent_id);
|
||||
if (r == -ENXIO)
|
||||
/* We have no parent, hence nothing to copy. */
|
||||
|
||||
Reference in New Issue
Block a user