Project

General

Profile

Bug #1841

SMB dtrace provider is incomplete

Added by Rich Lowe almost 8 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cifs - CIFS server and client
Start date:
2011-12-02
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

When probes were added to smbsrv, the obvious intent was that a SMB provider exist.
Unfortunately, the work was only half done, so instead we have probes like these:

7463        sdt            smbsrv         smb_post_write_and_unlock -smb_op-WriteAndUnlock-done
7464 sdt smbsrv smb_pre_write_and_unlock -smb_op-WriteAndUnlock-start
7473 sdt smbsrv smb_post_unlock_byte_range -smb_op-UnlockByteRange-done
7474 sdt smbsrv smb_pre_unlock_byte_range -smb_op-UnlockByteRange-start
7512 sdt smbsrv smb_post_lock_and_read -smb_op-LockAndRead-done
7513 sdt smbsrv smb_pre_lock_and_read -smb_op-LockAndRead-start
7550 sdt smbsrv smb_post_locking_andx -smb_op-LockingX-done
7551 sdt smbsrv smb_pre_locking_andx -smb_op-LockingX-start
7552 sdt smbsrv smb_post_lock_byte_range -smb_op-LockByteRange-done
7553 sdt smbsrv smb_pre_lock_byte_range -smb_op-LockByteRange-start

This is because DTRACE_SMB uses the _smb convention, but the work to sdt_subr was not done to create a "real" smb provider from them, so they remain in sdt, with silly names.

History

#1

Updated by Rich Lowe almost 8 years ago

It's worth noting that these probes don't look even somewhat useful as members of an actual smb provider. The fix here is not to just fix up sdt_subr and cause such a thing to exist.

#2

Updated by Gordon Ross almost 4 years ago

  • Assignee set to Gordon Ross
#3

Updated by Gordon Ross 5 months ago

The dtrace probes in the SMB1 code are almost all in the wrong places to be useful, so part of this work is to fix those.
The "begin" probes need to be after message parsing, tree lookup, file ID lookup, so the begin probe can provide access to those objects.
Some of the "done" probes also are poorly placed.

There's also some dtrace translator "magic" missing in usr/src/lib/libdtrace

#4

Updated by Gordon Ross 5 months ago

  • Subject changed from DTrace smb provider was mis-implemented, doesn't exist. to SMB dtrace provider is incomplete
  • Status changed from New to In Progress
#5

Updated by Gordon Ross 5 months ago

Testing involves running dtrace with these two scripts (new with this work) and observing the output.
https://github.com/gwr/illumos-gate/blob/smb3up9/usr/src/cmd/smbsrv/dtrace/smb-trace.d
https://github.com/gwr/illumos-gate/blob/smb3up9/usr/src/cmd/smbsrv/dtrace/smb2-trace.d

Fix has been in production for a couple years.

#6

Updated by Electric Monk 4 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 93bc28dbaee6387120d48b12b3dc1ba5f7418e6e

commit  93bc28dbaee6387120d48b12b3dc1ba5f7418e6e
Author: Gordon Ross <gwr@nexenta.com>
Date:   2019-06-04T02:09:35.000Z

    1841 SMB dtrace provider is incomplete
    11180 SMB2 IOCTL FSCTL_LMR_REQUEST_RESILIENCY Returns Incorrect Response
    Portions contributed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
    Reviewed by: Evan Layton <evan.layton@nexenta.com>
    Reviewed by: Matt Barden <matt.barden@nexenta.com>
    Reviewed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

#7

Updated by Electric Monk 4 months ago

git commit 262d6380c033d57f7438d7ef213bfe967788a59c

commit  262d6380c033d57f7438d7ef213bfe967788a59c
Author: Gordon Ross <gwr@nexenta.com>
Date:   2019-06-05T23:14:10.000Z

    1841 SMB dtrace provider is incomplete (fix dtrace breakage)
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF