[PATCH bpf-next v3 13/16] bpf: Enable the creation of hash map with dynptr key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hou Tao <houtao1@xxxxxxxxxx>

The support for bpf_dynptr key in hash map is in place, therefore
enable the creation of hash map with dynptr key in map_create().

Signed-off-by: Hou Tao <houtao1@xxxxxxxxxx>
---
 kernel/bpf/syscall.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 24599749dc6f9..f5bda7fdb746f 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -1262,9 +1262,10 @@ static int map_check_btf(struct bpf_map *map, struct bpf_token *token,
 			ret = -EACCES;
 			goto free_map_tab;
 		}
-		/* Enable for BPF_MAP_TYPE_HASH later */
-		ret = -EOPNOTSUPP;
-		goto free_map_tab;
+		if (map->map_type != BPF_MAP_TYPE_HASH) {
+			ret = -EOPNOTSUPP;
+			goto free_map_tab;
+		}
 	} else if (IS_ERR(map->key_record)) {
 		/* Return an error early even the bpf program doesn't use it */
 		ret = PTR_ERR(map->key_record);
-- 
2.29.2





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux