[mythtv] [patch] mythbackend MainServer::getFreeSpace

Nigel Pearson nigel at ind.tansu.com.au
Mon Feb 21 00:56:03 UTC 2005


	Hi Jim. Thanks for your patch and explanation.

> totalspace = (statbuf.f_blocks - (statbuf.f_bfree - statbuf.f_bavail)) 
> /
>                  (1024*1024/statbuf.f_bsize);
> usedspace = (statbuf.f_blocks - statbuf.f_bavail) /
>                  (1024*1024/statbuf.f_bsize);
>
> totalspace is adjusted to show total space for a non-root user, but
> usedspace isnt.  You can end up with the issue I have been seeing, 
> which
> is usedspace > totalspace when I really have 50G free.

	I am still thinking about this. My wife and I have been
amused when the "Delete Recordings" screen shows 101% or more
(on our KnoppMyth appliance).


	I agree that these should use the same calculations.
Note that similar code is also in util.cpp:diskUsage().

1) Do we want the backend, which is really just a user process,
    to just report freespace available to the user?

2) Or, do we assume that the backend will be running with some
    root-equiv privileges?

3) Or do we check the rights with getgid()?

--
Nigel Pearson, nigel at ind.tansu.com.au | "Gentlemen,
Telstra BI&D, Sydney, Australia       |  you can't fight in here
Office: 8255 4222    Fax:  8255 3153  |  - this is the war room!"
Mobile: 0408 664435  Home: 9792 6998  |      Dr Strangelove



More information about the mythtv-dev mailing list