Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: file related dev field extraction is dependent on the Filesystem type #1805

Open
FedeDP opened this issue Apr 19, 2024 · 1 comment
Open
Labels
kind/bug Something isn't working
Milestone

Comments

@FedeDP
Copy link
Contributor

FedeDP commented Apr 19, 2024

During the development of ppc64 me and @Andreagit97 noticed that some open related tests were failing to assert the dev field:

Expected equality of these values:
 *(T*)(m_event_params[m_current_param].valptr)
   Which is: 29
 param
   Which is: 37

Digging into it, we noticed that vfs_getattr_nosec calls a filesystem dependent getattr callback (https://elixir.bootlin.com/linux/v6.7.7/source/fs/stat.c#L135), that, for btrfs (the filesystem being used by our ppc64 test node), sets dev field differently: https://elixir.bootlin.com/linux/v6.7.7/source/fs/btrfs/inode.c#L8692.

See the call trace:

@[
    generic_fillattr+12
    btrfs_getattr+228
    vfs_getattr_nosec+244
    vfs_fstat+128
    __do_sys_newfstat+80
    system_call_exception+372
    system_call_vectored_common+348
]: 2

This means that our dev field is FS dependent and thus it cannot be relied upon.
There is no way to fix this (at least on eBPF probes), since we miss the needed helpers.

@FedeDP FedeDP added the kind/bug Something isn't working label Apr 19, 2024
@FedeDP
Copy link
Contributor Author

FedeDP commented Apr 19, 2024

/milestone TBD

@poiana poiana added this to the TBD milestone Apr 19, 2024
FedeDP added a commit that referenced this issue Apr 19, 2024
Refs #1805

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
FedeDP added a commit that referenced this issue Apr 22, 2024
Refs #1805

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
poiana pushed a commit that referenced this issue Apr 23, 2024
Refs #1805

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants