Of course this is quite old, but:
I had the same need as I have an NVME drive connected via a USB-C enclosure as I’m otherwise totally out of slots on the board, and any PCIe slots that could fit more converter cards. It’s just a scratch drive where data loss is a non issue.
This drive once every 1-2 months will be marked as suspended due to a sudden burst of I/O failures with no clear reason or pattern as to why (i.e. it doesn’t always occur right after some kind of scheduled maintenance task or similar).
The only thing I was able to suss out as even a possibility is that as great as uas is, implementations of it can be finicky or otherwise poor, and that it’s worth seeing if forcing the kernel to use the usb-storage driver for the device makes the problem stop, if your use case can tolerate the slight-to-moderate performance loss from the older driver.
If anyone else wants to try this, what you should do it execute the following (after inserting the correct values, then reboot (WARNING THIS WILL REPLACE EXISTING KERNEL EXTRA OPTIONS IF ANY YOU HAVE ANY ALREADY. SEE THE LATER SCRIPT FOR A BETTER SOLUTION IF SO):
midclt call system.advanced.update '{"kernel_extra_options": "usb-storage.quirks=xxxx:yyyy:u"}'
Where the values are as follows:
xxxx: USB Vendor ID
yyyy: Product ID
For example, 0bda:9210 is the full value for my Realtek RTL9210 based enclosure.
These values can be found in kernel logs, particularly from around when the device is connected. Note however that this command targets the controller of the enclosure by model so it will apply to any other USB enclosures you may also use and cannot be used to only affect one device. Generally this is fine, because if that controller does have a cruddy uas driver that should be avoided, then chances are you’d want that for all of your USB connected drives that use that controller.
The change should survive reboots and upgrades, but to be totally safe you could write a basic script that runs as post-init that first probes the kernel to see if the quirk is present and then adds it if it’s missing:
#!/bin/bash
QUIRK="usb-storage.quirks=0bda:9210:u"
CURRENT=$(midclt call system.advanced.config | jq -r '.kernel_extra_options // ""')
if \[\[ "$CURRENT" != *"$QUIRK"* \]\]; then
NEW=$(echo "$CURRENT $QUIRK" | xargs)
midclt call system.advanced.update "$(jq -n --arg v "$NEW" '{kernel_extra_options: $v}')"
logger -t ensure-uas-quirk "Kernel option was missing; re-added. Reboot needed to apply."
fi
As noted it won’t take effect till a reboot occurs, but ensures the fix will be applied again relatively quickly if it ever gets removed. You could add a forced reboot to the script (if having the system possibly suddenly reboot after, say, an update, is acceptable.
If going this method, just run this script manually once to enable the quirk for the first time.