selftests/bpf: Fix bpf selftest build error
Subsystems (5)
PATCH RESEND 1/1 selftests/bpf: Fix bpf selftest build error
On linux-next, build for bpf selftest displays an error due to mismatch in the expected function signature of bpf_testmod_test_read and bpf_testmod_test_write.
Commit 97d06802d10a ("sysfs: constify bin_attribute argument of bin_attribute::read/write()") changed the required type for struct bin_attribute to const struct bin_attribute.
To resolve the error, update corresponding signature for the callback.
---
[RESEND]:
- Added Fixes and Tested-by tag.
- Added Greg as receipent for driver-core tree.
Original patch: https://lore.kernel.org/all/[email protected]/
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +2 -2
@@ -385,7 +385,7 @@ int bpf_testmod_fentry_ok; noinline ssize_tbpf_testmod_test_read (struct file *file,struct kobject *kobj, -struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {struct bpf_testmod_test_read_ctx ctx = {
@@ -465,7 +465,7 @@ ALLOW_ERROR_INJECTION(bpf_testmod_test_read, ERRNO); noinline ssize_tbpf_testmod_test_write (struct file *file,struct kobject *kobj, -struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {struct bpf_testmod_test_write_ctx ctx = {
Signature · 1 line
2.43.5
Quoted 49 lines · Saket Kumar Bhaskar
On linux-next, build for bpf selftest displays an error due to mismatch in the expected function signature of
bpf_testmod_test_readandbpf_testmod_test_write.Commit
97d06802d10a("sysfs: constifybin_attributeargument of bin_attribute::read/write()") changed the required type for structbin_attributeto const structbin_attribute.To resolve the error, update corresponding signature for the callback.
Fixes 97d06802d10a ("sysfs: constify bin_attribute argument of bin_attribute::read/write()")Reported-by Venkat Rao Bagalkote <[email protected]>Tested-by Venkat Rao Bagalkote <[email protected]>Signed-off-by Saket Kumar Bhaskar <[email protected]>---
[RESEND]:
- Added Fixes and Tested-by tag.
- Added Greg as receipent for driver-core tree.Original patch: https://lore.kernel.org/all/[email protected]/
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +2
-3@@ -385,7 +385,7 @@ int bpf_testmod_fentry_ok; noinline ssize_tbpf_testmod_test_read (struct file *file,struct kobject *kobj, -struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {struct bpf_testmod_test_read_ctx ctx = {@@ -465,7 +465,7 @@ ALLOW_ERROR_INJECTION(bpf_testmod_test_read, ERRNO); noinline ssize_tbpf_testmod_test_write (struct file *file,struct kobject *kobj, - struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {struct bpf_testmod_test_write_ctx ctx = { --
Quoted 3 lines
2.43.5
The build is broken in Linus's tree right now. We also now need:
@@ -567,7 +567,7 @@ static void testmod_unregister_uprobe(void)
static ssize_t
bpf_testmod_uprobe_write(struct file *file, struct kobject *kobj,
- struct bin_attribute *bin_attr,
+ const struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t len)
{
Should I send a separate patch, or can we update this and get it to Linus?
Quoted 66 lines · T.J. Mercier
Quoted 49 lines · Saket Kumar Bhaskar
On linux-next, build for bpf selftest displays an error due to mismatch in the expected function signature of
bpf_testmod_test_readandbpf_testmod_test_write.Commit
97d06802d10a("sysfs: constifybin_attributeargument of bin_attribute::read/write()") changed the required type for structbin_attributeto const structbin_attribute.To resolve the error, update corresponding signature for the callback.
Fixes 97d06802d10a ("sysfs: constify bin_attribute argument of bin_attribute::read/write()")Reported-by Venkat Rao Bagalkote <[email protected]>Tested-by Venkat Rao Bagalkote <[email protected]>Signed-off-by Saket Kumar Bhaskar <[email protected]>---
[RESEND]:
- Added Fixes and Tested-by tag.
- Added Greg as receipent for driver-core tree.Original patch: https://lore.kernel.org/all/[email protected]/
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +2
-3@@ -385,7 +385,7 @@ int bpf_testmod_fentry_ok; noinline ssize_tbpf_testmod_test_read (struct file *file,struct kobject *kobj, -struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {struct bpf_testmod_test_read_ctx ctx = {@@ -465,7 +465,7 @@ ALLOW_ERROR_INJECTION(bpf_testmod_test_read, ERRNO); noinline ssize_tbpf_testmod_test_write (struct file *file,struct kobject *kobj, - struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {struct bpf_testmod_test_write_ctx ctx = { --Quoted 3 lines
2.43.5
The build is broken in Linus's tree right now. We also now need:
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +1
-1@@ -567,7 +567,7 @@ static void testmod_unregister_uprobe(void)static ssize_t bpf_testmod_uprobe_write (struct file *file,struct kobject *kobj, -struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {
Quoted 1 line
Should I send a separate patch, or can we update this and get it to Linus?
It was fixed in bpf tree couple days ago.
Song Liu
reviewerQuoted 66 lines · T.J. Mercier
Quoted 49 lines · Saket Kumar Bhaskar
On linux-next, build for bpf selftest displays an error due to mismatch in the expected function signature of
bpf_testmod_test_readandbpf_testmod_test_write.Commit
97d06802d10a("sysfs: constifybin_attributeargument of bin_attribute::read/write()") changed the required type for structbin_attributeto const structbin_attribute.To resolve the error, update corresponding signature for the callback.
Fixes 97d06802d10a ("sysfs: constify bin_attribute argument of bin_attribute::read/write()")Reported-by Venkat Rao Bagalkote <[email protected]>Tested-by Venkat Rao Bagalkote <[email protected]>Signed-off-by Saket Kumar Bhaskar <[email protected]>---
[RESEND]:
- Added Fixes and Tested-by tag.
- Added Greg as receipent for driver-core tree.Original patch: https://lore.kernel.org/all/[email protected]/
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +2
-3@@ -385,7 +385,7 @@ int bpf_testmod_fentry_ok; noinline ssize_tbpf_testmod_test_read (struct file *file,struct kobject *kobj, -struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {struct bpf_testmod_test_read_ctx ctx = {@@ -465,7 +465,7 @@ ALLOW_ERROR_INJECTION(bpf_testmod_test_read, ERRNO); noinline ssize_tbpf_testmod_test_write (struct file *file,struct kobject *kobj, - struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {struct bpf_testmod_test_write_ctx ctx = { --Quoted 3 lines
2.43.5
The build is broken in Linus's tree right now. We also now need:
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +1
-1@@ -567,7 +567,7 @@ static void testmod_unregister_uprobe(void)static ssize_t bpf_testmod_uprobe_write (struct file *file,struct kobject *kobj, -struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {
Quoted 1 line
Should I send a separate patch, or can we update this and get it to Linus?
A fix is already in the bpf tree, with this fix as well:
Thanks,
Song
Quoted 68 lines · Song Liu
Quoted 66 lines · T.J. Mercier
Quoted 49 lines · Saket Kumar Bhaskar
On linux-next, build for bpf selftest displays an error due to mismatch in the expected function signature of
bpf_testmod_test_readandbpf_testmod_test_write.Commit
97d06802d10a("sysfs: constifybin_attributeargument of bin_attribute::read/write()") changed the required type for structbin_attributeto const structbin_attribute.To resolve the error, update corresponding signature for the callback.
Fixes 97d06802d10a ("sysfs: constify bin_attribute argument of bin_attribute::read/write()")Reported-by Venkat Rao Bagalkote <[email protected]>Tested-by Venkat Rao Bagalkote <[email protected]>Signed-off-by Saket Kumar Bhaskar <[email protected]>---
[RESEND]:
- Added Fixes and Tested-by tag.
- Added Greg as receipent for driver-core tree.Original patch: https://lore.kernel.org/all/[email protected]/
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +2
-3@@ -385,7 +385,7 @@ int bpf_testmod_fentry_ok; noinline ssize_tbpf_testmod_test_read (struct file *file,struct kobject *kobj, -struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {struct bpf_testmod_test_read_ctx ctx = {@@ -465,7 +465,7 @@ ALLOW_ERROR_INJECTION(bpf_testmod_test_read, ERRNO); noinline ssize_tbpf_testmod_test_write (struct file *file,struct kobject *kobj, - struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {struct bpf_testmod_test_write_ctx ctx = { --Quoted 3 lines
2.43.5
The build is broken in Linus's tree right now. We also now need:
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +1
-1@@ -567,7 +567,7 @@ static void testmod_unregister_uprobe(void)static ssize_t bpf_testmod_uprobe_write (struct file *file,struct kobject *kobj, -struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) {
Quoted 8 lines
Quoted 1 line
Should I send a separate patch, or can we update this and get it to Linus?
A fix is already in the bpf tree, with this fix as well:
Thanks,
Song
Thanks, I was looking for it in driver-core.