[PATCH] Fix vfs.open probe use of 'cred' variable

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Fix vfs.open probe use of 'cred' variable

Frank Sorenson
Commit f6d683666 adjusted the vfs.open probe to obtain the $cred
target variable from a field of the $file target variable on
kernels where $cred is not available.  This change missed a
second reference to the $cred target variable within the probe.

Fix the reference to the possibly-unavailable target variable
by referencing the systemtap variable just obtained.

Fixes: Commit f6d683666 ("Adjust the vfs_open to provide cred variable with 4.18 kernels")
Signed-off-by: Frank Sorenson <[hidden email]>
---
 tapset/linux/vfs.stp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tapset/linux/vfs.stp b/tapset/linux/vfs.stp
index 7505dfa32..d513ff970 100644
--- a/tapset/linux/vfs.stp
+++ b/tapset/linux/vfs.stp
@@ -1298,7 +1298,7 @@ probe vfs.open = kernel.function("vfs_open") ?
         path = $path
         cred = @defined($cred) ? $cred : $file->f_cred
         pathname = fullpath_struct_path($path)
-        argstr = sprintf("%s, %p", pathname, $cred)
+        argstr = sprintf("%s, %p", pathname, cred)
 }
 
 probe vfs.open.return = kernel.function("vfs_open").return ?
--
2.20.1