You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by we...@apache.org on 2015/05/21 08:32:51 UTC

[1/2] trafficserver git commit: TS-3628 fix the bug that unable to use disk larger than 16T. thanks liubin

Repository: trafficserver
Updated Branches:
  refs/heads/master 1781a6815 -> 9725e10f8


TS-3628 fix the bug that unable to use disk larger than 16T. thanks
liubin <li...@letv.com>


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d75aa666
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d75aa666
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d75aa666

Branch: refs/heads/master
Commit: d75aa66601ecefd2235c36f5d8fa007188d104c7
Parents: 1781a68
Author: weijin <we...@letv.com>
Authored: Thu May 21 14:18:44 2015 +0800
Committer: 魏晋 <we...@letv.com>
Committed: Thu May 21 14:25:25 2015 +0800

----------------------------------------------------------------------
 iocore/cache/Cache.cc | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d75aa666/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 56fc808..becf713 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -681,12 +681,12 @@ CacheProcessor::start_internal(int flags)
     }
 
     int fd = open(path, opts, 0644);
-    int blocks = sd->blocks;
+    int64_t blocks = sd->blocks;
     if (fd > 0) {
       if (!sd->file_pathname) {
         if (!check) {
-          if (ftruncate(fd, ((uint64_t)blocks) * STORE_BLOCK_SIZE) < 0) {
-            Warning("unable to truncate cache file '%s' to %d blocks", path, blocks);
+          if (ftruncate(fd, blocks * STORE_BLOCK_SIZE) < 0) {
+            Warning("unable to truncate cache file '%s' to %" PRId64 " blocks", path, blocks);
             diskok = 0;
           }
         } else { // read-only mode
@@ -706,7 +706,7 @@ CacheProcessor::start_internal(int flags)
         CacheDisk *disk = new CacheDisk();
         if (check)
           disk->read_only_p = true;
-        Debug("cache_hosting", "interim Disk: %d, blocks: %d", gn_interim_disks, blocks);
+        Debug("cache_hosting", "interim Disk: %d, blocks: %" PRId64 "", gn_interim_disks, blocks);
         int sector_size = sd->hw_sector_size;
         if (sector_size < cache_config_force_sector_size)
           sector_size = cache_config_force_sector_size;
@@ -780,7 +780,7 @@ CacheProcessor::start_internal(int flags)
     }
 
     int fd = open(path, opts, 0644);
-    int blocks = sd->blocks;
+    int64_t blocks = sd->blocks;
 
     if (fd < 0 && (opts & O_CREAT)) // Try without O_DIRECT if this is a file on filesystem, e.g. tmpfs.
       fd = open(path, DEFAULT_CACHE_OPTIONS | O_CREAT, 0644);
@@ -788,8 +788,8 @@ CacheProcessor::start_internal(int flags)
     if (fd >= 0) {
       if (!sd->file_pathname) {
         if (!check) {
-          if (ftruncate(fd, ((uint64_t)blocks) * STORE_BLOCK_SIZE) < 0) {
-            Warning("unable to truncate cache file '%s' to %d blocks", path, blocks);
+          if (ftruncate(fd, blocks * STORE_BLOCK_SIZE) < 0) {
+            Warning("unable to truncate cache file '%s' to %" PRId64 " blocks", path, blocks);
             diskok = 0;
           }
         } else { // read-only mode checks
@@ -815,7 +815,7 @@ CacheProcessor::start_internal(int flags)
         if (sd->hash_base_string)
           gdisks[gndisks]->hash_base_string = ats_strdup(sd->hash_base_string);
 
-        Debug("cache_hosting", "Disk: %d, blocks: %d", gndisks, blocks);
+        Debug("cache_hosting", "Disk: %d, blocks: %" PRId64 "", gndisks, blocks);
 
         if (sector_size < cache_config_force_sector_size) {
           sector_size = cache_config_force_sector_size;


[2/2] trafficserver git commit: Add TS-3628

Posted by we...@apache.org.
Add TS-3628


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/9725e10f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9725e10f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9725e10f

Branch: refs/heads/master
Commit: 9725e10f8fa50a5af87554fc3d0396c97ea6411e
Parents: d75aa66
Author: weijin <we...@letv.com>
Authored: Thu May 21 14:31:48 2015 +0800
Committer: 魏晋 <we...@letv.com>
Committed: Thu May 21 14:31:48 2015 +0800

----------------------------------------------------------------------
 CHANGES | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9725e10f/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 9d32077..4dc8b33 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 6.0.0
   
+  *) [TS-3628] Unable to use disks larger than 16T
+
   *) [TS-2080] Remove arbitrary 1 year max age limit on the cache, use
    the existing configuration option properly.