This section lists the completion filters that an SMB client can request and the corresponding actions that Qumulo Core returns for a matched change.
Qumulo provides REST access to the same change notification system that backs SMB2
CHANGE_NOTIFY
. Because the notification interface and types are easier to work with compared to SMB2, we recommend programming by using REST rather than SMB CHANGE_NOTIFY
.Qumulo Core can watch for changes in file attributes and directory entries with a combination of SMB2 CHANGE_NOTIFY
filters. Depending on the requested filter—and activity in the file system—an SMB client or an application remains current by receiving a variety of notifications.
Commonly, these requests help limit the amount of traffic required to keep a current cache of entries for an open directory. The requests also help operating system applications such as Windows Explorer and macOS Finder update automatically when changes take place. It is also possible to make requests programmatically. For more information about language bindings, see the Windows Protocol documentation, such as ReadDirectoryChangesW function (winbase.h) for Win32 and FileSystemWatcher Class for .NET.
Completion Filter Types
Each request uses a completion filter to specify the events to watch for. When events occur, the system batches them into a NOTIFY
response that contains a list of FILE_ACTION
items, each tagged with the names of changed entries. As long as the handle for the watched directory remains open, events queue up on the server, so that no events are lost between NOTIFY
requests.
- Watching for Name Changes: A name change can include four event types.
- Renaming
- Deleting
- Moving into watched directory
- Moving out of watched directory
The returned action specifies to your application whether an entry has been added, renamed, or removed.
- Watching for Metadata Changes: A metadata change can include six supported attribute types.
- File attributes
- File size
- Last-write time
- Last-access time
- Creation time
- Security (the permissions or access control list for the file or directory)
Note
Qumulo doesn’t support mutating extended attributes (EA). If the system requests only theFILE_NOTIFY_CHANGE_EA
filter, no events propagate.
Completion Filters and Corresponding Actions
The following table shows the requested completion filters (grouped by the number of inode reads required to support them), the changes they watch for, and the actions that correspond to them.
Completion Filters | Actions | Description |
---|---|---|
The following filters watch for name changes ( • • |
• • • • • |
When Qumulo Core watches names, it notifies the client when there is an added, removed, or renamed file or directory in the watched directory. A [REMOVED, file_old_name], [ADDED, file_new_name] |
The following filters watch for metadata changes ( • • • • • • Note
Qumulo doesn’t support mutating extended attributes (EA). If the system requests only the FILE_NOTIFY_CHANGE_EA filter, no events propagate. |
FILE_ACTION_MODIFIED
|
When one of the watched attributes changes for an entry of the watched directory and the filter is requested, the client receives a Note
In Microsoft terminology, attributes are flags. For more information, see File Attributes in the Open Specification documentation. |
The following filters watch for alternative data stream (ADS) changes ( • • • |
• • • |
Consider the following example command. echo "data" > watched_dir/file0:stream This command generates the following event. [ADDED_STREAM, file0:stream] |
If you don’t supply a filter, the SMB server accepts the request but doesn’t send any notifications.
Re-Enumerating Changes after the STATUS_ENUM_DIR Error
If the SMB client can’t keep up with the notification stream from the server, the server returns the STATUS_ENUM_DIR
error code to the client and stops sending notifications.
In this scenario, the client must re-enumerate any changes that concern it directly, by opening and inspecting files, rather than relying on notifications. This scenario can happen because the request is too broad, for example, a recursive watch on the file system root.
Configuring Full Recursion for the WATCH_TREE Flag
By default, when a client supplies the WATCH_TREE
flag, the server sends an error to the client immediately. In this scenario, you can configure your Qumulo cluster to support full recursion.