Index: server/core.c
===================================================================
--- server/core.c	(revision 615874)
+++ server/core.c	(working copy)
@@ -154,6 +154,7 @@
 
     conf->enable_mmap = ENABLE_MMAP_UNSET;
     conf->enable_sendfile = ENABLE_SENDFILE_UNSET;
+    conf->enable_double_stat = ENABLE_DOUBLE_STAT_UNSET;
     conf->allow_encoded_slashes = 0;
 
     return (void *)conf;
@@ -411,6 +412,10 @@
         conf->enable_sendfile = new->enable_sendfile;
     }
 
+    if (new->enable_double_stat != ENABLE_DOUBLE_STAT_UNSET) {
+        conf->enable_double_stat = new->enable_double_stat;
+    }
+
     conf->allow_encoded_slashes = new->allow_encoded_slashes;
 
     return (void*)conf;
@@ -1653,7 +1658,30 @@
     return NULL;
 }
 
+static const char *set_enable_double_stat(cmd_parms *cmd, void *d_,
+                                   const char* arg)
+{
+    core_dir_config *d = d_;
+    const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT);
 
+    if (err != NULL) {
+        return err;
+    }
+
+    if (strcasecmp(arg, "on") == 0) {
+        d->enable_double_stat = ENABLE_DOUBLE_STAT_ON;
+    }
+    else if (strcasecmp(arg, "off") == 0) {
+        d->enable_double_stat = ENABLE_DOUBLE_STAT_OFF;
+    }
+    else {
+        return "parameter must be 'on' or 'off'";
+    }
+
+    return NULL;
+}
+
+
 /*
  * Report a missing-'>' syntax error.
  */
@@ -3232,6 +3260,8 @@
   "Controls whether memory-mapping may be used to read files"),
 AP_INIT_TAKE1("EnableSendfile", set_enable_sendfile, NULL, OR_FILEINFO,
   "Controls whether sendfile may be used to transmit files"),
+AP_INIT_TAKE1("EnableDoubleStat", set_enable_double_stat, NULL, OR_FILEINFO,
+  "Controls whether to stat the open file in default handler"),
 
 /* Old server config file commands */
 
@@ -3610,7 +3640,16 @@
                           "file permissions deny server access: %s", r->filename);
             return HTTP_FORBIDDEN;
         }
-
+	
+        if ((ENABLE_DOUBLE_STAT_ON == d->enable_double_stat) && 
+	    (status = apr_file_info_get(&r->finfo, APR_FINFO_MIN, fd) ) 
+	    != APR_SUCCESS) {
+	    ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
+			  "unable to read from fd of : %s", r->filename);
+            apr_file_close(fd);
+            return HTTP_INTERNAL_SERVER_ERROR;
+        }
+	
         ap_update_mtime(r, r->finfo.mtime);
         ap_set_last_modified(r);
         ap_set_etag(r);
Index: include/http_core.h
===================================================================
--- include/http_core.h	(revision 615874)
+++ include/http_core.h	(working copy)
@@ -541,6 +541,11 @@
 #define USE_CANONICAL_PHYS_PORT_UNSET (2)
     unsigned use_canonical_phys_port : 2;
 
+#define ENABLE_DOUBLE_STAT_OFF    (0)
+#define ENABLE_DOUBLE_STAT_ON     (1)
+#define ENABLE_DOUBLE_STAT_UNSET  (2)    
+    unsigned enable_double_stat: 2;
+
 } core_dir_config;
 
 /* Per-server core configuration */
