(zpool) is attempting to use unsafe AIO requests

Started by allenlook, September 19, 2025, 05:24:52 PM

Previous topic - Next topic
September 19, 2025, 05:24:52 PM Last Edit: September 20, 2025, 01:04:58 PM by allenlook
I've recently noticed the following message in my boot log, but everything is running great.

"pid 31 (zpool) is attempting to use unsafe AIO requests - not logging anymore"

A search of the intertubes does not show anything certain about the message.

I have an N100 mini PC, with only one SSD drive and one partition, and it has been running ZFS since installation.

I run the SMART monitor on the drive, and it reports everything is OK.

At this point I'm going to do nothing about it, but I wanted to ask the question here so at least there's something in future Google-fu's about it.
Minisforum UN100D, N100, 8GB, 256GB nVME w/ZFS

September 21, 2025, 02:47:18 PM #1 Last Edit: September 21, 2025, 02:55:21 PM by jangw
Disclaimer: I am not a ZFS developer but took a quick look at their code base.

It happens when the zpool is imported and ZFS attempts AIO on file descriptors where FreeBSD thinks it is not safe to do so. In such a case FreeBSD raises the EOPNOTSUPP errno (https://man.freebsd.org/cgi/man.cgi?query=aio_read&sektion=2&n=1). That is not an issue - ZFS simply tries again, the second time without AIO.

For the details, look here: https://github.com/openzfs/zfs/blob/6ba51da93b01b5636e7eea48a325bedf3fc4d36a/lib/libzutil/zutil_import.c#L1076 . If EOPNOTSUPP is set, the switch statement falls through such that do_slow is set to true and on line 1086 the second, "slow" attempt is performed.

So, in my (unqualified) opinion, there is no reason to be concerned about this message. Your zpool is imported correctly and you still  benefit from asynchronous I/O.

For not being a ZFS developer that's a pretty good find, and I agree with you, that code calls the same function, but throws the b_slow flag/error.

I just wish it didn't stop logging, as I'd like to comb through my boot logs to see if everything is OK, but the log file stops right at that error message.

Thank you for the strong response!
Minisforum UN100D, N100, 8GB, 256GB nVME w/ZFS

September 23, 2025, 05:43:40 PM #3 Last Edit: September 23, 2025, 05:54:02 PM by jangw
Maybe something shows up in the output of
zpool events -v zrootafter boot?

Pool data integrity (checksums) can be verified with
zpool scrub zrootthen wait a minute or so, and finally run
zpool status zrootto make sure that all error counts are zero.

You could make the error disappear by setting the tunable vfs.aio.enable_unsafe = 1 (https://man.freebsd.org/cgi/man.cgi?query=aio, second paragraph). But I'm not sure if that is safe and would not recommend it in production.

Thank you for the reply.

I ran the scrub and all of the error counts were zero.

I opted not to set the tunable, and I'll live with the error for now.
Minisforum UN100D, N100, 8GB, 256GB nVME w/ZFS