zfs/module
Brian Behlendorf 16da688f25 Linux 5.13 compat: retry zvol_open() when contended
Due to a possible lock inversion the zvol open call path on Linux
needs to be able to retry in the case where the spa_namespace_lock
cannot be acquired.

For Linux 5.12 an older kernel this was accomplished by returning
-ERESTARTSYS from zvol_open() to request that blkdev_get() drop
the bdev->bd_mutex lock, reaquire it, then call the open callback
again.  However, as of the 5.13 kernel this behavior was removed.

Therefore, for 5.12 and older kernels we preserved the existing
retry logic, but for 5.13 and newer kernels we retry internally in
zvol_open().  This should always succeed except in the case where
a pool's vdev are layed on zvols, in which case it may fail.  To
handle this case vdev_disk_open() has been updated to retry when
opening a device when -ERESTARTSYS is returned.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #12301
Closes #12759
2021-12-06 12:22:57 -08:00
..
avl Fix various typos 2021-04-07 13:27:11 -07:00
icp Use fallthrough macro 2021-11-02 09:50:30 -07:00
lua Use fallthrough macro 2021-11-02 09:50:30 -07:00
nvpair A few fixes of callback typecasting (for the upcoming ClangCFI) 2021-09-14 12:39:48 -07:00
os Linux 5.13 compat: retry zvol_open() when contended 2021-12-06 12:22:57 -08:00
spl Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
unicode Fix various typos 2021-04-07 13:27:11 -07:00
zcommon Fix AVX512BW Fletcher code on AVX512-but-not-BW machines 2021-05-10 12:05:36 -07:00
zfs Linux 5.13 compat: retry zvol_open() when contended 2021-12-06 12:22:57 -08:00
zstd Fix cross-endian interoperability of zstd 2021-09-14 15:05:55 -07:00
.gitignore Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
Kbuild.in Add zstd support to zfs 2020-08-20 10:30:06 -07:00
Makefile.bsd Restore FreeBSD resource usage accounting 2021-02-19 22:34:33 -08:00
Makefile.in FreeBSD module --enable-debug --enable-invariants 2021-03-05 12:16:41 -08:00