]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Removed nfs_check. So much trouble and so unreliable..
authorTimo Sirainen <tss@iki.fi>
Tue, 3 Feb 2009 17:05:35 +0000 (12:05 -0500)
committerTimo Sirainen <tss@iki.fi>
Tue, 3 Feb 2009 17:05:35 +0000 (12:05 -0500)
--HG--
branch : HEAD

src/master/mail-process.c
src/master/master-settings.c
src/master/master-settings.h

index 248621b6be16992b37ae521b126265ba5389e63b..a5d985dab8750d176858811f0f95ea7278ba4e16 100644 (file)
@@ -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));
index ad72042b1fcacec7d4533039554ff1bd4b83940c..bedb4d103bcc9cf2b3ed98c3f02415075273c411 100644 (file)
@@ -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,
 
index 15ec1d7c9dcac9abe8842f6e44fb905483ad41ad..b9f30eb121cff993edbc51eb3c742312260f5f42 100644 (file)
@@ -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;