-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopen_file_cache_aio_fix.patch
More file actions
executable file
·54 lines (42 loc) · 1.64 KB
/
Copy pathopen_file_cache_aio_fix.patch
File metadata and controls
executable file
·54 lines (42 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1315153882 0
# Node ID 16eaef9fbf7335a8ab02ce308799647b26bd11f9
# Parent 5d94f8b3e01d74ec6bd5bdcae176a8d3b998237d
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 noticiable with AIO though, as errors wasn't properly logged.
diff --git a/src/core/ngx_open_file_cache.c b/src/core/ngx_open_file_cache.c
--- a/src/core/ngx_open_file_cache.c
+++ b/src/core/ngx_open_file_cache.c
@@ -290,6 +290,8 @@ ngx_open_cached_file(ngx_open_file_cache
file->use_event = 1;
}
+ of->is_directio = file->is_directio;
+
goto renew;
}
diff --git a/src/os/unix/ngx_file_aio_read.c b/src/os/unix/ngx_file_aio_read.c
--- a/src/os/unix/ngx_file_aio_read.c
+++ b/src/os/unix/ngx_file_aio_read.c
@@ -86,6 +86,9 @@ ngx_file_aio_read(ngx_file_t *file, u_ch
return aio->nbytes;
}
+ ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
+ "aio read \"%s\" failed", file->name.data);
+
return NGX_ERROR;
}
diff --git a/src/os/unix/ngx_linux_aio_read.c b/src/os/unix/ngx_linux_aio_read.c
--- a/src/os/unix/ngx_linux_aio_read.c
+++ b/src/os/unix/ngx_linux_aio_read.c
@@ -74,6 +74,10 @@ ngx_file_aio_read(ngx_file_t *file, u_ch
}
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;
}