Mercurial > hg > nginx
changeset 4161:010a0907bc95 stable-1.0
Merging r4077, r4101, r4102:
open_file_cache related fixes:
*) Bugfix: open_file_cache lost is_directio flag.
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.
*) Bugfix: open_file_cache did not update file info on retest.
If file inode was not changed, cached file information was not updated
on retest. As a result stale information might be cached forever if file
attributes was changed and/or file was extended.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 30 Sep 2011 13:57:44 +0000 |
parents | 88369902edb1 |
children | fb1375e8b68c |
files | src/core/ngx_open_file_cache.c src/os/unix/ngx_file_aio_read.c src/os/unix/ngx_linux_aio_read.c |
diffstat | 3 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_open_file_cache.c Fri Sep 30 13:42:59 2011 +0000 +++ b/src/core/ngx_open_file_cache.c Fri Sep 30 13:57:44 2011 +0000 @@ -284,13 +284,13 @@ if (of->uniq == file->uniq) { - file->count++; - if (file->event) { file->use_event = 1; } - goto renew; + of->is_directio = file->is_directio; + + goto update; } /* file was changed */ @@ -394,8 +394,6 @@ } } -renew: - file->created = now; found:
--- a/src/os/unix/ngx_file_aio_read.c Fri Sep 30 13:42:59 2011 +0000 +++ b/src/os/unix/ngx_file_aio_read.c Fri Sep 30 13:57:44 2011 +0000 @@ -86,6 +86,9 @@ return aio->nbytes; } + ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno, + "aio read \"%s\" failed", file->name.data); + return NGX_ERROR; }
--- a/src/os/unix/ngx_linux_aio_read.c Fri Sep 30 13:42:59 2011 +0000 +++ b/src/os/unix/ngx_linux_aio_read.c Fri Sep 30 13:57:44 2011 +0000 @@ -74,6 +74,10 @@ } 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; }