Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 4920 - Samba dosen't properly count large (> 2GB) filesystems
Summary: Samba dosen't properly count large (> 2GB) filesystems
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: samba
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-09-05 00:21 UTC by vectro
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-09-19 23:14:43 UTC

Attachments (Terms of Use)

Description vectro 1999-09-05 00:21:44 UTC
When performing tar or ls operations, samba uses an int
value to count the number of bytes. An unsigned long long is
more appropriate for this operation, but is not included in
the samba distribution because (AFAIK) it is not a
widely-supported type. It is, however, supported by RH6.0's
version of gcc/egcs/glibc.

This patch will change the type to an unsigned long long and
alleviate the issue:

diff -Naur samba-2.0.3/source/client/client.c
--- samba-2.0.3/source/client/client.c  Sat Feb 27 14:08:58
+++ samba-2.0.3-fix/source/client/client.c      Sat Sep  4
16:56:47 1999
@@ -101,7 +101,7 @@
 int put_total_time_ms = 0;

 /* totals globals */
-int dir_total = 0;
+unsigned long long dir_total = 0;

 #define USENMB

@@ -430,7 +430,7 @@


-       DEBUG(3, ("Total bytes listed: %d\n", dir_total));
+       DEBUG(3, ("Total bytes listed: %llu\n", dir_total));

diff -Naur samba-2.0.3/source/client/clitar.c
--- samba-2.0.3/source/client/clitar.c  Sat Feb 27 14:08:59
+++ samba-2.0.3-fix/source/client/clitar.c      Sat Sep  4
16:57:59 1999
@@ -85,7 +85,8 @@

 static char *tarbuf, *buffer_p;
-static int tp, ntarf, tbufsiz, ttarf;
+static int tp, ntarf, tbufsiz;
+static unsigned long long ttarf;
 /* Incremental mode */
 BOOL tar_inc=False;
 /* Reset archive bit */
@@ -1512,7 +1513,7 @@

     DEBUG(0, ("tar: dumped %d tar files\n", ntarf));
-    DEBUG(0, ("Total bytes written: %d\n", ttarf));
+    DEBUG(0, ("Total bytes written: %llu\n", ttarf));

And here is the appropriate spec file patch:

--- samba-old.spec      Sat Sep  4 17:09:10 1999
+++ samba.spec  Sat Sep  4 17:00:33 1999
@@ -12,6 +12,7 @@
 Patch1: smbw.patch
 Patch2: samba-glibc21.patch
 Patch3: samba-2.0.3-fixinit.patch
+Patch4: samba-2.0.3-largefs.patch
 Requires: pam >= 0.64
 BuildRoot: /var/tmp/samba-root
 Prereq: chkconfig fileutils
@@ -47,6 +48,7 @@
 %patch1 -p1 -b .smbw
 %patch2 -p1 -b .glibc21
 %patch3 -p1 -b .fixinit
+%patch4 -p1

 cd source

Comment 1 Michael K. Johnson 1999-09-19 23:14:59 UTC
This appears to be fixed in 2.0.5a, which uses a double instead
of a long long and then formats it appropriately.  2.0.5a is
included in RawHide and will be included in Red Hat Linux 6.1

Note You need to log in before you can comment on or make changes to this bug.