Date: Sat, 6 Mar 2004 09:46:34 +0100 (CET) From: Lukas Ertl <le@FreeBSD.org> To: Kris Kennaway <kris@obsecurity.org> Cc: pjd@FreeBSD.org Subject: Re: bin/62536: df gives insane numbers when using root-reserved space Message-ID: <20040306094559.F614@korben.in.tern> In-Reply-To: <20040306084156.GA28164@xor.obsecurity.org> References: <200403051548.i25Fmmsa073994@freefall.freebsd.org> <20040306084156.GA28164@xor.obsecurity.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 6 Mar 2004, Kris Kennaway wrote: > On Fri, Mar 05, 2004 at 07:48:48AM -0800, Lukas Ertl wrote: > > Synopsis: df gives insane numbers when using root-reserved space > > > > Responsible-Changed-From-To: freebsd-bugs->le > > Responsible-Changed-By: le > > Responsible-Changed-When: Fri Mar 5 07:48:22 PST 2004 > > Responsible-Changed-Why: > > I probably have a fix for this. > > pjd has a patch for this as well..I haven't yet tested it. Ah, good. My patch looks like this: ---8<--- Index: bin/df/df.c =================================================================== RCS file: /home/ncvs/src/bin/df/df.c,v retrieving revision 1.55 diff -u -r1.55 df.c --- bin/df/df.c 5 Mar 2004 08:10:16 -0000 1.55 +++ bin/df/df.c 5 Mar 2004 15:51:00 -0000 @@ -400,7 +400,8 @@ */ #define fsbtoblk(num, fsbs, bs) \ (((fsbs) != 0 && (fsbs) < (bs)) ? \ - (num) / ((bs) / (fsbs)) : (num) * ((fsbs) / (bs))) + (num) / (int64_t)((bs) / (fsbs)) : \ + (num) * (int64_t)((fsbs) / (bs))) /* * Print out status about a file system. ---8<--- cheers, le -- Lukas Ertl http://mailbox.univie.ac.at/~le/ le@FreeBSD.org http://people.freebsd.org/~le/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040306094559.F614>