Bug 4920 - Samba dosen't properly count large (> 2GB) filesystems
Samba dosen't properly count large (> 2GB) filesystems
Status: CLOSED NEXTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: samba (Show other bugs)
6.0
All Linux
high Severity high
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-09-04 20:21 EDT by vectro
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-09-19 19:14:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description vectro 1999-09-04 20:21:44 EDT
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-fix/source/client/client.c
--- samba-2.0.3/source/client/client.c  Sat Feb 27 14:08:58
1999
+++ 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 @@

        do_dskattr();

-       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-fix/source/client/clitar.c
--- samba-2.0.3/source/client/clitar.c  Sat Feb 27 14:08:59
1999
+++ samba-2.0.3-fix/source/client/clitar.c      Sat Sep  4
16:57:59 1999
@@ -85,7 +85,8 @@
 #endif

 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 @@
     free(tarbuf);

     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));
     break;
   }

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

 %build
 cd source
Comment 1 Michael K. Johnson 1999-09-19 19:14:59 EDT
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.