Folder watching under Linux might be broken for SMB2/3 network filesystems. #7892

Closed
opened 2026-02-21 19:13:45 -05:00 by deekerman · 2 comments
Owner

Originally created by @Cilph on GitHub (Oct 9, 2018).

Please provide the following information

qBittorrent version and Operating System

qBittorrent 4.1.3, Debian Linux 9

What is the problem

Running qBittorrent in a docker setup, watching a networked SMB folder (/downloads/watch/), results in no torrents being added either by inotify or polling. Except on startup and local changes. The folder is mounted as SMB3 (vers=3.0)

What is the expected behavior

The watched folder will be polled periodically.

Extra info(if any)

I've did some of my own investigation and found that stat reports the networked folder as of type smb2. Peeking into Utils::Fs::isNetworkFileSystem reveals checks for CIFS, NFS and SMB. SMB2 however uses a different magic number (0xFE534D42) compared to the one listed (0x517B) which seems to only match SMB1. This would result in no periodic polling being done on the watched folder. The difference being presumably because of the large protocol differences between SMB1 and SMB2/3. Adjusting my mount options to use SMB1 explicitly (vers=1.0) seems to fix the issue entirely, seemingly confirming my hypothesis.

Originally created by @Cilph on GitHub (Oct 9, 2018). **Please provide the following information** ### qBittorrent version and Operating System qBittorrent 4.1.3, Debian Linux 9 ### What is the problem Running qBittorrent in a docker setup, watching a networked SMB folder (/downloads/watch/), results in no torrents being added either by inotify or polling. Except on startup and local changes. The folder is mounted as SMB3 (vers=3.0) ### What is the expected behavior The watched folder will be polled periodically. ### Extra info(if any) I've did some of my own investigation and found that `stat` reports the networked folder as of type `smb2`. Peeking into `Utils::Fs::isNetworkFileSystem` reveals checks for CIFS, NFS and SMB. SMB2 however uses a different magic number (0xFE534D42) compared to the one listed (0x517B) which seems to only match SMB1. This would result in no periodic polling being done on the watched folder. The difference being presumably because of the large protocol differences between SMB1 and SMB2/3. Adjusting my mount options to use SMB1 explicitly (vers=1.0) seems to fix the issue entirely, seemingly confirming my hypothesis.
Author
Owner

@Chocobo1 commented on GitHub (Oct 9, 2018):

Thanks for reporting! I've submitted PR #9673.

@Chocobo1 commented on GitHub (Oct 9, 2018): Thanks for reporting! I've submitted PR #9673.
Author
Owner

@Chocobo1 commented on GitHub (Oct 11, 2018):

Will be fixed in next release v4.1.4.

@Chocobo1 commented on GitHub (Oct 11, 2018): Will be fixed in next release v4.1.4.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#7892
No description provided.