Skip to content

Commit 5e30e6e

Browse files
committed
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 125cca1
1 parent e603a43 commit 5e30e6e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/shared/btrfs-util.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,8 @@ static int copy_quota_hierarchy(int fd, uint64_t old_subvol_id, uint64_t new_sub
11871187
if (n_old_qgroups <= 0) /* Nothing to copy */
11881188
return n_old_qgroups;
11891189

1190+
assert(old_qgroups); /* Coverity gets confused by the macro iterator allocating this, add a hint */
1191+
11901192
r = btrfs_subvol_get_parent(fd, old_subvol_id, &old_parent_id);
11911193
if (r == -ENXIO)
11921194
/* We have no parent, hence nothing to copy. */

0 commit comments

Comments
 (0)