Does your application depend on, or report, free disk space? Re: F20 Self Contained Change: OS Installer Support for LVM Thin Provisioning

Eric Sandeen sandeen at redhat.com
Sat Jul 27 02:29:41 UTC 2013


On 7/26/13 3:13 PM, Miloslav Trmač wrote:
> Hello all,
> with thin provisioning available, the total and free space values
> reported by a filesystem do not necessarily mean that that much space
> is _actually_ available (the actual backing storage may be smaller, or
> shared with other filesystems).
> 
> If your package reports disk space usage to users, and bases this on
> filesystem free space, please consider whether it might need to take
> LVM thin provisioning into account.

Short answer: it doesn't (it can't).

Just like an application doesn't know if it's got a 2.5" or 3.5" drive
behind it, or cloud behind it, or a usb stick behind it, it doesn't
know if it's got thinly provisioned storage behind it.

It's up to the administrator to make sure that the thinly provisioned
device doesn't fill up & run out of space, but if it does, there's
nothing an app can do about that.

There's also no standard interface to query how full your thinly
provisioned storage is; it depends on what's implementing the thin
provisioning.  So again, nothing an app can do/query/handle/change.

> The same applies if your package automatically allocates a certain
> proportion of the total or available space.

I can't imagine that anything actually does that, does it?
Good lord I hope not.  ;)
 
> A quick way to check whether your package is likely to be affected, is
> to look for statfs() or statvfs() calls in C, or the equivalent in
> your higher-level library / programming language.

statfs will still tell you how much space the filesystem has allocated,
as well as how much space it thinks it has left, based on the total
space the disk has *said* it has available, just like it always ever
did.

The difference, of course, is that you might actually run out of blocks
before you fill the fs.  But I can't think offhand what apps would care.
And again, it's something the admin shouldn't let happen.

For now, consider it completely transparent to the user (unless the
admin doesn't keep up, in which case it will be anything *but*
transparent).

TBH, when the backing store runs out of space, things do get pretty
ugly at this point.  It's work that needs to be done to make it more
robust & graceful.

-Eric

>      Mirek
> 



More information about the devel mailing list