dfree is broken on this system

Jason Mader jason at ncac.gwu.edu
Tue Sep 28 17:48:44 GMT 2004


I've reported this to Bugzilla as bug #1843.  I encountered the 
following warning when running on Irix 6.5.23f with quotas enabled, 
where there was a hard block limit but no soft block limit.

[2004/07/08 10:53:30, 0] smbd/dfree.c:(138)
   WARNING: dfree is broken on this system

James Peach wrote this patch, that I've also added to the bug notes, 
that I have tested in 3.0.6 and 3.0.7 and it eliminates the warning.

diff -r -u reference/source/smbd/quotas.c 
samba-3.0.6rc2/source/smbd/quotas.c
--- reference/source/smbd/quotas.c	Fri Jul  9 03:06:10 2004
+++ samba-3.0.6rc2/source/smbd/quotas.c	Mon Aug  9 15:10:32 2004
@@ -882,8 +882,17 @@
      restore_re_uid();

      if (r==-1)
+    {
+      DEBUG(5, ("quotactl for uid=%u: %s", euser_id, strerror(errno)));
        return(False);
+    }

+    /* No quota for this user. */
+    if (F.d_blk_softlimit==0 && F.d_blk_hardlimit==0)
+    {
+      return(False);
+    }
+
      /* Use softlimit to determine disk space, except when it has been 
exceeded */
      if (
          (F.d_blk_softlimit && F.d_bcount>=F.d_blk_softlimit) ||
@@ -895,14 +904,10 @@
        *dfree = 0;
        *dsize = F.d_bcount;
      }
-    else if (F.d_blk_softlimit==0 && F.d_blk_hardlimit==0)
-    {
-      return(False);
-    }
      else
      {
        *dfree = (F.d_blk_softlimit - F.d_bcount);
-      *dsize = F.d_blk_softlimit;
+      *dsize = F.d_blk_softlimit ? F.d_blk_softlimit : 
F.d_blk_hardlimit;
      }

    }

---Jason Mader, FHWA/NHTSA National Crash Analysis Center,
The George Washington University, VA Campus



More information about the samba-technical mailing list