com php-src: Merge branch 'PHP-5.6' into PHP-7.0: ext/opcache/ZendAccelerator.c

From: Date: Wed, 16 Nov 2016 22:14:23 +0000
Subject: com php-src: Merge branch 'PHP-5.6' into PHP-7.0: ext/opcache/ZendAccelerator.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95809@lists.php.net to get a copy of this message
Commit: 27542d9c9dc3a2971517d4afadde8a408c034d17 Author: Dmitry Stogov <dmitry@zend.com> Thu, 17 Nov 2016 01:14:23 +0300 Parents: 1d8be7c044c0e4a7d985e7b02fe81644a636542d 9849c97b1bdfd7f0a7c499cad4cf601ebd68cc22 Branches: PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=27542d9c9dc3a2971517d4afadde8a408c034d17 Log: Merge branch 'PHP-5.6' into PHP-7.0 * PHP-5.6: Accorate handling of too big inodes of chroot directories Changed paths: MM ext/opcache/ZendAccelerator.c Diff: diff --cc ext/opcache/ZendAccelerator.c index 230cc3d,7e8a444..1491c88 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@@ -2091,18 -2155,14 +2091,16 @@@ static void accel_activate(void if (stat("/", &buf) != 0) { ZCG(root_hash) = 0; } else { - zend_ulong x = buf.st_ino; - - #if SIZEOF_ZEND_LONG == 4 - x = ((x >> 16) ^ x) * 0x45d9f3b; - x = ((x >> 16) ^ x) * 0x45d9f3b; - x = (x >> 16) ^ x; - #elif SIZEOF_ZEND_LONG == 8 - x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; - x = (x ^ (x >> 27)) * 0x94d049bb133111eb; - x = x ^ (x >> 31); - #endif - ZCG(root_hash) = x; + ZCG(root_hash) = buf.st_ino; + if (sizeof(buf.st_ino) > sizeof(ZCG(root_hash))) { + if (ZCG(root_hash) != buf.st_ino) { - zend_alter_ini_entry("opcache.enable", sizeof("opcache..enable"), "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_RUNTIME); ++ zend_string *key = zend_string_init("opcache.enable", sizeof("opcache.enable")-1, 0); ++ zend_alter_ini_entry_chars(key, "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_RUNTIME); ++ zend_string_release(key); + zend_accel_error(ACCEL_LOG_WARNING, "Can't cache files in chroot() directory with too big inode"); + return; + } + } } } else { ZCG(root_hash) = 0;

« previous php.cvs (#95809) next »