Skip to content

Commit 0e39c9e

Browse files
Dan Carpenterkdave
authored andcommitted
btrfs: qgroup: fix initialization of auto inherit array
The "i++" was accidentally left out so it just sets qgids[0] over and over. This can lead to unexpected problems, as the groups[1:] would be all 0, leading to later find_qgroup_rb() unable to find a qgroup and cause snapshot creation failure. Fixes: 5343cd9 ("btrfs: qgroup: simple quota auto hierarchy for nested subvolumes") CC: [email protected] # 6.7+ Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent bc00965 commit 0e39c9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/qgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3123,7 +3123,7 @@ static int qgroup_auto_inherit(struct btrfs_fs_info *fs_info,
31233123
qgids = res->qgroups;
31243124

31253125
list_for_each_entry(qg_list, &inode_qg->groups, next_group)
3126-
qgids[i] = qg_list->group->qgroupid;
3126+
qgids[i++] = qg_list->group->qgroupid;
31273127

31283128
*inherit = res;
31293129
return 0;

0 commit comments

Comments
 (0)