From: Timo Sirainen Date: Tue, 3 Feb 2009 17:05:35 +0000 (-0500) Subject: Removed nfs_check. So much trouble and so unreliable.. X-Git-Tag: 2.0.alpha1~1037^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35c8e2439a8ca9234993b2594875eb15f0e363d6;p=thirdparty%2Fdovecot%2Fcore.git Removed nfs_check. So much trouble and so unreliable.. --HG-- branch : HEAD --- diff --git a/src/master/mail-process.c b/src/master/mail-process.c index 248621b6be..a5d985dab8 100644 --- a/src/master/mail-process.c +++ b/src/master/mail-process.c @@ -269,44 +269,6 @@ void mail_process_exec(const char *protocol, const char **args) i_fatal_status(FATAL_EXEC, "execv(%s) failed: %m", executable); } -static void nfs_warn_if_found(const char *mail, const char *full_home_dir) -{ - struct mountpoint point; - const char *path; - - if (mail == NULL || *mail == '\0') - path = full_home_dir; - else { - path = strstr(mail, ":INDEX="); - if (path != NULL) { - /* indexes set separately */ - path += 7; - if (strncmp(path, "MEMORY", 6) == 0) - return; - } else { - path = strchr(mail, ':'); - if (path == NULL) { - /* autodetection for path */ - path = mail; - } else { - /* format:path */ - path++; - } - } - path = home_expand_tilde(t_strcut(path, ':'), full_home_dir); - } - - if (mountpoint_get(path, pool_datastack_create(), &point) <= 0) - return; - - if (point.type == NULL || strcasecmp(point.type, "NFS") != 0) - return; - - i_fatal("Mailbox indexes in %s are in NFS mount. " - "You must set mail_nfs_index=yes to avoid index corruptions. " - "If you're sure this check was wrong, set nfs_check=no.", path); -} - enum master_login_status create_mail_process(enum process_type process_type, struct master_settings *set, const struct mail_login_request *request, @@ -327,7 +289,7 @@ create_mail_process(enum process_type process_type, struct master_settings *set, ARRAY_DEFINE(extra_args, const char *); unsigned int i, len, count, left, process_count, throttle; int ret, log_fd, nice_value, chdir_errno; - bool home_given, nfs_check; + bool home_given; i_assert(process_type == PROCESS_TYPE_IMAP || process_type == PROCESS_TYPE_POP3); @@ -465,15 +427,6 @@ create_mail_process(enum process_type process_type, struct master_settings *set, fd_close_on_exec(log_fd, TRUE); } - /* See if we need to do the initial NFS check. We want to do this only - once, so the check code needs to be before fork(). */ - if (set->nfs_check && !set->mail_nfs_index && !dump_capability) { - set->nfs_check = FALSE; - nfs_check = TRUE; - } else { - nfs_check = FALSE; - } - pid = fork(); if (pid < 0) { i_error("fork() failed: %m"); @@ -622,16 +575,6 @@ create_mail_process(enum process_type process_type, struct master_settings *set, } env_put(str_c(expanded_vars)); - if (nfs_check) { - /* ideally we should check all of the namespaces, - but for now don't bother. */ - const char *mail_location = getenv("NAMESPACE_1"); //FIXME - - if (mail_location == NULL) - mail_location = getenv("MAIL"); - nfs_warn_if_found(mail_location, full_home_dir); - } - env_put("LOGGED_IN=1"); if (*home_dir != '\0') env_put(t_strconcat("HOME=", home_dir, NULL)); diff --git a/src/master/master-settings.c b/src/master/master-settings.c index ad72042b1f..bedb4d103b 100644 --- a/src/master/master-settings.c +++ b/src/master/master-settings.c @@ -154,7 +154,6 @@ static struct setting_define master_setting_defines[] = { DEF(SET_STR, ssl), DEF(SET_STR, ssl_key_file), DEF(SET_UINT, ssl_parameters_regenerate), - DEF(SET_BOOL, nfs_check), DEF(SET_BOOL, version_ignore), /* login */ @@ -191,7 +190,6 @@ static struct setting_define master_setting_defines[] = { DEF(SET_STR_VARS, mail_location), DEF(SET_BOOL, mail_debug), - DEF(SET_BOOL, mail_nfs_index), DEF(SET_UINT, umask), DEF(SET_BOOL, mail_drop_priv_before_exec), @@ -225,7 +223,6 @@ struct master_settings master_default_settings = { MEMBER(ssl) "yes", MEMBER(ssl_key_file) SSLDIR"/private/dovecot.pem", MEMBER(ssl_parameters_regenerate) 168, - MEMBER(nfs_check) TRUE, MEMBER(version_ignore) FALSE, /* login */ @@ -261,7 +258,6 @@ struct master_settings master_default_settings = { MEMBER(mail_location) "", MEMBER(mail_debug) FALSE, - MEMBER(mail_nfs_index) FALSE, MEMBER(umask) 0077, MEMBER(mail_drop_priv_before_exec) FALSE, diff --git a/src/master/master-settings.h b/src/master/master-settings.h index 15ec1d7c9d..b9f30eb121 100644 --- a/src/master/master-settings.h +++ b/src/master/master-settings.h @@ -65,7 +65,6 @@ struct master_settings { const char *ssl; const char *ssl_key_file; unsigned int ssl_parameters_regenerate; - bool nfs_check; bool version_ignore; /* login */ @@ -100,7 +99,6 @@ struct master_settings { const char *mail_location; bool mail_debug; - bool mail_nfs_index; unsigned int umask; bool mail_drop_priv_before_exec;