Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4499 - trunk/src/os/unix

Anonymous User
February 28, 2012 06:10AM
Author: mdounin
Date: 2012-02-28 11:09:02 +0000 (Tue, 28 Feb 2012)
New Revision: 4499

Log:
Workaround for fs_size on ZFS (ticket #46).

ZFS reports incorrect st_blocks until file settles on disk, and this
may take a while (i.e. just after creation of a file the st_blocks value
is incorrect). As a workaround we now use st_blocks only if
st_blocks * 512 > st_size, this should fix ZFS problems while still
preserving accuracy for other filesystems.

The problem had appeared in r3900 (1.0.1).


Modified:
trunk/src/os/unix/ngx_files.h

Modified: trunk/src/os/unix/ngx_files.h
===================================================================
--- trunk/src/os/unix/ngx_files.h 2012-02-27 22:15:39 UTC (rev 4498)
+++ trunk/src/os/unix/ngx_files.h 2012-02-28 11:09:02 UTC (rev 4499)
@@ -180,7 +180,7 @@
#define ngx_is_exec(sb) (((sb)->st_mode & S_IXUSR) == S_IXUSR)
#define ngx_file_access(sb) ((sb)->st_mode & 0777)
#define ngx_file_size(sb) (sb)->st_size
-#define ngx_file_fs_size(sb) ((sb)->st_blocks * 512)
+#define ngx_file_fs_size(sb) ngx_max((sb)->st_size, (sb)->st_blocks * 512)
#define ngx_file_mtime(sb) (sb)->st_mtime
#define ngx_file_uniq(sb) (sb)->st_ino

@@ -276,7 +276,8 @@

#define ngx_de_access(dir) (((dir)->info.st_mode) & 0777)
#define ngx_de_size(dir) (dir)->info.st_size
-#define ngx_de_fs_size(dir) ((dir)->info.st_blocks * 512)
+#define ngx_de_fs_size(dir) \
+ ngx_max((dir)->info.st_size, (dir)->info.st_blocks * 512)
#define ngx_de_mtime(dir) (dir)->info.st_mtime



_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4499 - trunk/src/os/unix

Anonymous User 1135 February 28, 2012 06:10AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 276
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready