mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Allow to control failfast
Linux defaults to setting "failfast" on BIOs, so that the OS will not retry IOs that fail, and instead report the error to ZFS. In some cases, such as errors reported by the HBA driver, not the device itself, we would wish to retry rather than generating vdev errors in ZFS. This new property allows that. This introduces a per vdev option to disable the failfast option. This also introduces a global module parameter to define the failfast mask value. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Allan Jude <allan@klarasystems.com> Signed-off-by: Allan Jude <allan@klarasystems.com> Signed-off-by: Mariusz Zaborski <mariusz.zaborski@klarasystems.com> Sponsored-by: Seagate Technology LLC Submitted-by: Klara, Inc. Closes #14056
This commit is contained in:
@@ -126,7 +126,8 @@ typedef int bvec_iterator_t;
|
||||
#endif
|
||||
|
||||
static inline void
|
||||
bio_set_flags_failfast(struct block_device *bdev, int *flags)
|
||||
bio_set_flags_failfast(struct block_device *bdev, int *flags, bool dev,
|
||||
bool transport, bool driver)
|
||||
{
|
||||
#ifdef CONFIG_BUG
|
||||
/*
|
||||
@@ -148,7 +149,12 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags)
|
||||
#endif /* BLOCK_EXT_MAJOR */
|
||||
#endif /* CONFIG_BUG */
|
||||
|
||||
*flags |= REQ_FAILFAST_MASK;
|
||||
if (dev)
|
||||
*flags |= REQ_FAILFAST_DEV;
|
||||
if (transport)
|
||||
*flags |= REQ_FAILFAST_TRANSPORT;
|
||||
if (driver)
|
||||
*flags |= REQ_FAILFAST_DRIVER;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -355,6 +355,7 @@ typedef enum {
|
||||
VDEV_PROP_BYTES_TRIM,
|
||||
VDEV_PROP_REMOVING,
|
||||
VDEV_PROP_ALLOCATING,
|
||||
VDEV_PROP_FAILFAST,
|
||||
VDEV_NUM_PROPS
|
||||
} vdev_prop_t;
|
||||
|
||||
|
||||
@@ -299,6 +299,7 @@ struct vdev {
|
||||
uint64_t vdev_islog; /* is an intent log device */
|
||||
uint64_t vdev_noalloc; /* device is passivated? */
|
||||
uint64_t vdev_removing; /* device is being removed? */
|
||||
uint64_t vdev_failfast; /* device failfast setting */
|
||||
boolean_t vdev_ishole; /* is a hole in the namespace */
|
||||
uint64_t vdev_top_zap;
|
||||
vdev_alloc_bias_t vdev_alloc_bias; /* metaslab allocation bias */
|
||||
|
||||
Reference in New Issue
Block a user