libtorrent error when trying to save a torrent on a network location (NAS) using F2FS, ext4 or exfat file system. #7763
Description
libtorrent version (or branch): 2.0.10.0. Same error with 1.2.19 too.
platform/architecture: Operating system: Windows 11 Pro x64 (23H2) 22631.4317 - I've tried it on two different PCs.
It works on Debian. It creates folders on the same NAS drive and completes the torrent.
I came here because of this issue - qbittorrent/qBittorrent#21669
As qbittorrent uses libtorrent and a user guided me that the issue is with libtorrent I open an issue here too.
When I open a torrent file and choose a network location on a NAS drive to save it, qbittorrent gives an error. This happens when a new directory for the torrent should be created.
I get - "Parameter error" and qbittorrent is unable to make a directory for the torrent, If I choose qbittoreent not to create a directory then all torrent files are written properly to the NAS SSD. Or if I create the directory manually before adding the torrent file then the torrent files writing to disk is OK.
The program creates a file (instead of a folder) without any extension with an unrecognized empty icon under Windows File Explorer.
When I choose to remove the torrent and data from the qbittorrent the file is not removed and remains on the NAS drive.
In my case I have a SSD USB3 (formatted with F2FS file system) attached to my OpenWrt router and I use it as a NAS device.
Everything else works OK with this setup. I have automated backups on that NAS drive. Other programs like GoodSync, uTorrent, File Explorer, WinRAR, Total Commander can create/delete folders on the same F2FS formatted NAS drive on Windows 11.
Using other torrent clients like uTorrent with the same torrent files results in successful operation.
Screenshots below.
Steps to reproduce
Steps to reproduce are like opening any other torrent the usual way but choose to create folder for the torrent.
I cannot tell if the F2FS file system have any impact here because I tried to save the same torrent to another shared network folder on a Windows 11 PC and it was OK.
I know that this may be somewhat unusual setup (F2FS mostly) and maybe because of this the issue went unnoticed.
I suppose (my speculation here) that the issue maybe caused by recent commits introduced with the kernel 6.6.54.
https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.54
There are lots of F2FS related commits there. And probably libtorrent (qbittorrent) has some issues with those commits too.
Additional context
22.10.2024 г. 16:57 - File error alert. Torrent: "xxxxxxxxxxxxxxxxxxx". File: "\qnap\qnap-usb1".
Reason: " error: The parameter is incorrect"
I use SMB - ksmbd.
I've found and reported KSMBD errors in the past but the version hasn't changed for a few months.
I first thought that it was KSMBD issue again but version is the same and it worked OK since the reported issue was resolved.