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.
This commit is contained in:
Maxim Dounin 2011-09-05 16:36:19 +00:00
parent 3a73e50498
commit 4f65a05d18
3 changed files with 9 additions and 0 deletions

View 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;
}

View 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;
}

View 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;
}