| To: | Andreas Dilger <adilger@xxxxxxxxx> |
|---|---|
| Subject: | Re: fallocate mode flag for "unshare blocks"? |
| From: | Henk Slager <eye1tm@xxxxxxxxx> |
| Date: | Thu, 31 Mar 2016 18:47:50 +0200 |
| Cc: | Christoph Hellwig <hch@xxxxxxxxxxxxx>, Liu Bo <bo.li.liu@xxxxxxxxxx>, "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>, xfs@xxxxxxxxxxx, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, linux-btrfs <linux-btrfs@xxxxxxxxxxxxxxx>, linux-api@xxxxxxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=cr0mp3MkKrLey9HNPFx/ebgRbndrOhZz3M51xQgoYko=; b=Bdq5JiovTYWhS3AAp4kY6E/ev3SopyW9mIO4+0dGFA4DIOP+frH8gNWlnCMGg6z08b yboLtv4n9LRPPSCybTLHL03dHDJxqROCqmPOlBBf0U/j93zrgW/dSwt0bU1bbEyxiQYP dOSnpa35OsxQeiEo/Oyj8jDEhnhsrzTsdITDTr3vANZrPB8tZwgQbvoeH4euK5AZ2YbS gJpL79WC65xIqAaSe2Fj3XAz6kCECZh01pR2ALHnLG2bAPK2nF005ZZQh3xw+jhcBFOp LM8NGVb+0zlwFo2egD3mvucJXe+2foeXpSCxC+0fbWnroS3XaSVL8TUafbK9r/B2u2St RiZg== |
| In-reply-to: | <3E147309-67EA-4B29-B4E0-883BA03B7BFC@xxxxxxxxx> |
| References: | <20160302155007.GB7125@xxxxxxxxxxxxx> <20160330182755.GC2236@xxxxxxxxxxxxxxxx> <20160331003242.GA5813@xxxxxxxxxxxxxxxxxxxxx> <20160331075529.GB4209@xxxxxxxxxxxxx> <3E147309-67EA-4B29-B4E0-883BA03B7BFC@xxxxxxxxx> |
On Thu, Mar 31, 2016 at 5:31 PM, Andreas Dilger <adilger@xxxxxxxxx> wrote: > On Mar 31, 2016, at 1:55 AM, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote: >> >> On Wed, Mar 30, 2016 at 05:32:42PM -0700, Liu Bo wrote: >>> Well, btrfs fallocate doesn't allocate space if it's a shared one >>> because it thinks the space is already allocated. So a later overwrite >>> over this shared extent may hit enospc errors. >> >> And this makes it an incorrect implementation of posix_fallocate, >> which glibcs implements using fallocate if available. > > It isn't really useful for a COW filesystem to implement fallocate() > to reserve blocks. Even if it did allocate all of the blocks on the > initial fallocate() call, when it comes time to overwrite these blocks > new blocks need to be allocated as the old ones will not be overwritten. There are also use-cases on BTRFS with CoW disabled, like operations on virtual machine images that aren't snapshotted. Those files tend to be big and having fallocate() implemented and working like for e.g. XFS, in order to achieve space and speed efficiency, makes sense IMHO. |
| Previous by Date: | Internal error at xfs_trans_cancel, Avi Kivity |
|---|---|
| Next by Date: | Re: fallocate mode flag for "unshare blocks"?, J. Bruce Fields |
| Previous by Thread: | Re: fallocate mode flag for "unshare blocks"?, Austin S. Hemmelgarn |
| Next by Thread: | Re: fallocate mode flag for "unshare blocks"?, Austin S. Hemmelgarn |
| Indexes: | [Date] [Thread] [Top] [All Lists] |