Bug 1172775

Summary: dereferencing pointer to incomplete type struct knfsd_fh
Product: Red Hat Developer Toolset Reporter: Martin Cermak <mcermak>
Component: systemtapAssignee: Frank Ch. Eigler <fche>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: medium Docs Contact:
Priority: unspecified    
Version: DTS 3.0 RHEL 7CC: dsmith, fche, kanderso, lberk, mbenitez, mcermak, mfranc, mjw
Target Milestone: alpha   
Target Release: 3.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: devtoolset-3-systemtap-2.6-9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1171823 Environment:
Last Closed: 2015-04-23 08:02:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1171823    
Bug Blocks:    

Description Martin Cermak 2014-12-10 17:28:51 UTC
+++ This bug was initially created as a clone of Bug #1171823 +++

With systemtap-2.6-7.el7 and kernel-3.10.0-206.el7 I see following issue:

# stap -v -c 'ls /tmp/some-nfs-mounted-dir' -e 'probe nfsd.open{print(fh)}'
Pass 1: parsed user script and 114 library script(s) using 218252virt/35588res/3020shr/33140data kb, in 150usr/20sys/163real ms.
Pass  2: analyzed script: 3 probe(s), 4 function(s), 7 embed(s), 1 global(s)  using 342580virt/161080res/4156shr/157468data kb, in  1720usr/380sys/2110real ms.
Pass  3: translated to C into  "/tmp/stapOF3Ipl/stap_4c24a6feff91c0788091460de2197891_5006_src.c" using  342580virt/161380res/4456shr/157468data kb, in 200usr/60sys/254real ms.
/tmp/stapOF3Ipl/stap_4c24a6feff91c0788091460de2197891_5006_src.c: In function ‘function___svc_fh’:
/tmp/stapOF3Ipl/stap_4c24a6feff91c0788091460de2197891_5006_src.c:240:28: error: dereferencing pointer to incomplete type
  struct knfsd_fh *fh = &fhp->fh_handle;
                            ^
make[2]: *** [/tmp/stapOF3Ipl/stap_4c24a6feff91c0788091460de2197891_5006_src.o] Error 1
make[1]: *** [_module_/tmp/stapOF3Ipl] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_4c24a6feff91c0788091460de2197891_5006.ko" in 650usr/270sys/843real ms.
Pass 4: compilation failed.  [man error::pass4]

----------------

<@fche> so the problem appears to be that struct svc_fh's declaration moved from  include/linux/nfsd/nfsfh.h to  
              fs/nfsd/nfsfh.h
<@fche> the latter is not accessible to stap's embedded-c code

--- Additional comment from David Smith on 2014-12-08 21:05:56 CET ---

Fixed upstream in commit f739850:

<https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=commitdiff;h=f73985072571f93684e7742733d8d06b477b02bf;hp=eb7d25eccd83ccda7f24e4281e4d3044395f56c6>

This commit should easily backport.

--- Additional comment from David Smith on 2014-12-08 23:20:10 CET ---

Upstream commit 957812a simplifies the previous fix and should be backported as well:

<https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=patch;h=957812abcb03ad5eb2b544c7fff111b967deb211>

... stuff deleted ...

Comment 4 errata-xmlrpc 2015-04-23 08:02:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-0881.html