LWN.net Logo

Linux Storage and Filesystem Workshop, day 2

Linux Storage and Filesystem Workshop, day 2

Posted Apr 18, 2009 22:10 UTC (Sat) by giraffedata (subscriber, #1954)
In reply to: Linux Storage and Filesystem Workshop, day 2 by willy
Parent article: Linux Storage and Filesystem Workshop, day 2

That's no more interesting than the simpler problem that when you go to extend a sequential file, the write request fails even though the filesystem has space available.
This was in the context of an application having used the posix_fallocate() call. If that call succeeds, the application is guaranteed to be able to use the storage that has been so allocated. Thin Provisioning breaks this, and it's far from clear how to fix it.

No, posix_fallocate() doesn't guarantee you can use the storage. Your write to it could fail, for example, due to a media defect. What posix_fallocate() guarantees is that a write won't fail because there is no space left in the filesystem. That's the same guarantee you get from mkfs that if you create a 1G filesystem, you can put (about) 1G of files in it. So it's equally interesting that with thin provisioning, your fallocated space within a file may be unusable as that your filesystem space may be unusable for extending the file.

With thin provisioning, the filesystem storage medium is a volume in the storage server, which does in fact have space for the write in question. What doesn't have space is the server's pool of backing storage, and the effect of that is a write to certain sectors of the volume fails.


(Log in to post comments)

Linux Storage and Filesystem Workshop, day 2

Posted Apr 20, 2009 14:35 UTC (Mon) by willy (subscriber, #9762) [Link]

The text from the standard says:
DESCRIPTION
The posix_fallocate() function shall ensure that any required storage for regular file data starting at offset and continuing for len bytes is allocated on the file system storage media. If posix_fallocate() returns successfully, subsequent writes to the specified file data shall not fail due to the lack of free space on the file system storage media.
I stand by my assertion that it is currently impossible to provide this with Thin Provisioning without actually writing to every single block.

Linux Storage and Filesystem Workshop, day 2

Posted Apr 20, 2009 16:05 UTC (Mon) by giraffedata (subscriber, #1954) [Link]

That's entirely consistent with what I wrote. There is space in the filesystem. (If there weren't, the write would fail with ENOSPC and statfs() would show no space).

The only problem is that writes to certain sectors of the storage medium fail for reasons out of the scope of POSIX.

There's layering going on here.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds