Bug #3523


SMB NT Notify returning too soon

Added by Gordon Ross almost 9 years ago. Updated almost 9 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


When many Windows clients have an "explorer" window open on some directory,
where they all have an SMB NT Notify operation pending to watch for changes on
that directory, the server will sometimes get into a mode where these notify
operations all return almost immediately. This causes the clients to essentially
"spam" the server with directory listing requests.

Typically the first observation that "something is wrong" is that server load is higher than expected, or that directory listings are taking longer than expected. A network capture taken during such an episode will show floods of FindFirst/FindNext calls, interspersed with occasional NT Notify calls, where the NT Notify calls return almost immediately.

Actions #1

Updated by Gordon Ross almost 9 years ago

The implementation of NT Notify uses flags in the node structure (node->flags,
and see NODE_FLAGS_NOTIFY_CHANGE) which are modified without any locks.

The design needed significant work. Here's the updated design:

The smb node has a list of "subscribers" for events, and in each element of
that list are held the flags indicating which events that subscriber wants,
and a condition variable on which the subsriber blocks while waiting.
When FEM (or other event sources) deliver an event to some smb node,
this list of subscribers is walked, and any events that match the mask
will store the event information and signal the condition variable.
The now ublocked subscriber does the rest of the work.

This eliminates the silly global lists of pending change notify requests,
signaled change notify events, and the worker thread that used to send
the change notify responses; thereby removing a "bottle neck".

Actions #2

Updated by Gordon Ross almost 9 years ago

  • Status changed from New to Pending RTI
Actions #3

Updated by Gordon Ross almost 9 years ago

  • Status changed from Pending RTI to Resolved
commit ccc71be50bb49efb4e31004c77fb3e065e9c0596
Author: Gordon Ross <>
Date:   Wed Oct 10 20:07:26 2012 -0400

    3523 SMB NT Notify returning too soon
    Reviewed by: Albert Lee <>
    Reviewed by: Dan McDonald <>
    Reviewed by: Yakov Zaytsev <>
    Approved by: Richard Lowe <>

:100644 100644 21dff73... 7d53466... M  usr/src/uts/common/fs/smbsrv/smb_common_
:100644 100644 e32b5fc... 38cfab1... M  usr/src/uts/common/fs/smbsrv/smb_fem.c
:100644 100644 68e3224... f9ec3fa... M  usr/src/uts/common/fs/smbsrv/smb_fsops.c
:100644 100644 bd69147... bfb08c2... M  usr/src/uts/common/fs/smbsrv/smb_node.c
:100644 100644 1e4d9df... 35bdf74... M  usr/src/uts/common/fs/smbsrv/smb_nt_canc
:100644 100644 2efd4cb... 4b6befa... M  usr/src/uts/common/fs/smbsrv/smb_nt_tran
:100644 100644 6855a79... 3963517... M  usr/src/uts/common/fs/smbsrv/smb_ofile.c
:100644 100644 ca09cf4... 8541fdc... M  usr/src/uts/common/fs/smbsrv/smb_rename.
:100644 100644 9eeb7d8... 3654744... M  usr/src/uts/common/fs/smbsrv/smb_server.
:100644 100644 6e1bd6d... f2a3371... M  usr/src/uts/common/fs/smbsrv/smb_session
:100644 100644 7c5c9f3... 3006153... M  usr/src/uts/common/smbsrv/smb_kproto.h
:100644 100644 4ce1967... 53bceab... M  usr/src/uts/common/smbsrv/smb_ktypes.h

Also available in: Atom PDF