]> git.kaiwu.me - nginx.git/commitdiff
Bugfix: open_file_cache lost is_directio flag.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 5 Sep 2011 16:36:19 +0000 (16:36 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 5 Sep 2011 16:36:19 +0000 (16:36 +0000)
On file retest open_file_cache lost is_directio if file wasn't changed.
This caused unaligned operations under Linux to fail with EINVAL.
It wasn't noticeable with AIO though, as errors wasn't properly logged.

src/core/ngx_open_file_cache.c
src/os/unix/ngx_file_aio_read.c
src/os/unix/ngx_linux_aio_read.c

index a70385c35441cdea49693c13fa53bcc0149436e1..1cce9e92b34340ff5b2e775631010f063f3042ed 100644 (file)
@@ -290,6 +290,8 @@ ngx_open_cached_file(ngx_open_file_cache_t *cache, ngx_str_t *name,
                     file->use_event = 1;
                 }
 
+                of->is_directio = file->is_directio;
+
                 goto renew;
             }
 
index ef7a461079f880034ec1491934efe9c0de20ae85..557f9de6ab1c8282daa860c34b496e306f4215b1 100644 (file)
@@ -86,6 +86,9 @@ ngx_file_aio_read(ngx_file_t *file, u_char *buf, size_t size, off_t offset,
             return aio->nbytes;
         }
 
+        ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
+                      "aio read \"%s\" failed", file->name.data);
+
         return NGX_ERROR;
     }
 
index 72875ca01016ea5dfb976dbcd69f0ecf00a99c27..b9d1d01cd424ff9d6b3559e7d605a92eec9db88f 100644 (file)
@@ -74,6 +74,10 @@ ngx_file_aio_read(ngx_file_t *file, u_char *buf, size_t size, off_t offset,
         }
 
         ngx_set_errno(-aio->res);
+
+        ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
+                      "aio read \"%s\" failed", file->name.data);
+
         return NGX_ERROR;
     }