Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jun 2013 02:47:23 +0800 (CST)
From:      Hung-Yi Chen <gaod@hychen.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/179268: [PATCH] www/trafficserver: Fix disk usage miscalculated
Message-ID:  <201306031847.r53IlNoj080612@cse.tw>
Resent-Message-ID: <201306031850.r53Io1t3010472@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         179268
>Category:       ports
>Synopsis:       [PATCH] www/trafficserver: Fix disk usage miscalculated
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 03 18:50:01 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Hung-Yi Chen
>Release:        FreeBSD 9.1-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD cse.tw 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64


>Description:
        FreeBSD miscalculates disk size based on config by 2x for file-based, and 16x for raw-based.
        Apply upstream fix, see https://issues.apache.org/jira/browse/TS-1784.

>How-To-Repeat:
>Fix:


--- trafficserver.diff begins here ---
Index: www/trafficserver/Makefile
===================================================================
--- www/trafficserver/Makefile	(revision 319796)
+++ www/trafficserver/Makefile	(working copy)
@@ -7,6 +7,7 @@
 
 PORTNAME=	trafficserver
 PORTVERSION=	3.2.4
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	APACHE/${PORTNAME}
 
Index: www/trafficserver/files/patch-iocore_cache_Store.cc
===================================================================
--- www/trafficserver/files/patch-iocore_cache_Store.cc	(revision 0)
+++ www/trafficserver/files/patch-iocore_cache_Store.cc	(working copy)
@@ -0,0 +1,29 @@
+--- iocore/cache/Store.cc.orig	2013-05-25 01:18:36.000000000 +0800
++++ iocore/cache/Store.cc	2013-05-25 01:20:00.000000000 +0800
+@@ -483,7 +483,9 @@
+   disk_id = devnum;
+ 
+   pathname = ats_strdup(an);
+-  blocks = size / hw_sector_size;
++  // igalic: blocks = size / hw_sector_size; was wrong TS-1707
++  // This code needs refactoring to unify the code-paths which are equal across platforms.
++  blocks = size / STORE_BLOCK_SIZE;
+   file_pathname = !((s.st_mode & S_IFMT) == S_IFDIR);
+ 
+   // This is so FreeBSD admins don't worry about our malicious code creating boot sector viruses:
+@@ -583,6 +585,7 @@
+ 
+   pathname = ats_strdup(filename);
+   // is this right Seems like this should be size / hw_sector_size
++  // igalic: No. See TS-1707
+   blocks = size / STORE_BLOCK_SIZE;
+   file_pathname = !((s.st_mode & S_IFMT) == S_IFDIR);
+ 
+@@ -715,6 +718,7 @@
+     /* I don't know why I'm redefining blocks to be something that is quite
+      * possibly something other than the actual number of blocks, but the
+      * code for other arches seems to.  Revisit this, perhaps. */
++    // igalic: No. See TS-1707
+     blocks = size / STORE_BLOCK_SIZE;
+     
+     Debug("cache_init", "Span::init physical sectors %" PRId64 " total size %" PRId64 " geometry size %" PRId64 " store blocks %" PRId64 "",
--- trafficserver.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306031847.r53IlNoj080612>