@@ -417,6 +417,7 @@
conf->max_fds = 0;
conf->attribute_flags = 0;
conf->flush_on_last_del = 0;
+ conf->file_timeout = DEFAULT_FILE_TIMEOUT;
/*
* read the config file
@@ -84,6 +84,7 @@
int pg_prio_calc;
int log_checker_err;
int fast_io_fail;
+ int file_timeout;
unsigned int dev_loss;
uid_t uid;
gid_t gid;
@@ -12,6 +12,7 @@
#define DEFAULT_PGTIMEOUT -PGTIMEOUT_NONE
#define DEFAULT_USER_FRIENDLY_NAMES 0
#define DEFAULT_VERBOSITY 2
+#define DEFAULT_FILE_TIMEOUT 90
#define DEFAULT_CHECKINT 5
#define MAX_CHECKINT(a) (a << 2)
@@ -85,6 +85,21 @@
}
static int
+file_timeout_handler(vector strvec)
+{
+ char * buff;
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+ conf->file_timeout = atoi(buff);
+ if (conf->file_timeout < 0)
+ conf->file_timeout = DEFAULT_FILE_TIMEOUT;
+
+ FREE(buff);
+ return 0;
+}
+
+static int
udev_dir_handler(vector strvec)
{
conf->udev_dir = set_value(strvec);
@@ -1848,6 +1863,12 @@
}
static int
+snprint_file_timeout(char * buff, int len, void * data)
+{
+ return snprintf(buff, len, "%i", conf->file_timeout);
+}
+
+static int
snprint_def_udev_dir (char * buff, int len, void * data)
{
if (!conf->udev_dir)
@@ -2153,6 +2174,7 @@
install_keyword("gid", &def_gid_handler, &snprint_def_gid);
install_keyword("fast_io_fail_tmo", &def_fast_io_fail_handler, &snprint_def_fast_io_fail);
install_keyword("dev_loss_tmo", &def_dev_loss_handler, &snprint_def_dev_loss);
+ install_keyword("file_timeout", &file_timeout_handler, &snprint_file_timeout);
__deprecated install_keyword("default_selector", &def_selector_handler, NULL);
__deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
__deprecated install_keyword("default_getuid_callout", &def_getuid_callout_handler, NULL);
@@ -181,7 +181,6 @@
* not multipath(8), ran by udev
*/
#if DAEMON
-#define WAIT_MAX_SECONDS 90
#define WAIT_LOOP_PER_SECOND 5
static int
@@ -190,7 +189,7 @@
int loop;
struct stat stats;
- loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND;
+ loop = conf->file_timeout * WAIT_LOOP_PER_SECOND;
while (--loop) {
if (stat(filename, &stats) == 0)
@@ -632,7 +631,7 @@
return 1;
#if DAEMON
- int loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND;
+ int loop = conf->file_timeout * WAIT_LOOP_PER_SECOND;
while (loop--) {
sdev = sysfs_open_device_path(attr_buff);