]> git.kaiwu.me - nginx.git/commitdiff
Bugfix: open_file_cache did not update file info on retest.
authorIgor Sysoev <igor@sysoev.ru>
Wed, 14 Sep 2011 14:12:35 +0000 (14:12 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 14 Sep 2011 14:12:35 +0000 (14:12 +0000)
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.

This fix also makes obsolete r4077 change of is_directio flag handling,
since this flag is updated together with other file information.

src/core/ngx_open_file_cache.c

index 1cce9e92b34340ff5b2e775631010f063f3042ed..1306d14b037e4190667bcc4e6f3822037d0a7b39 100644 (file)
@@ -284,15 +284,11 @@ ngx_open_cached_file(ngx_open_file_cache_t *cache, ngx_str_t *name,
 
             if (of->uniq == file->uniq) {
 
-                file->count++;
-
                 if (file->event) {
                     file->use_event = 1;
                 }
 
-                of->is_directio = file->is_directio;
-
-                goto renew;
+                goto update;
             }
 
             /* file was changed */
@@ -396,8 +392,6 @@ update:
         }
     }
 
-renew:
-
     file->created = now;
 
 found: