linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Murphy <lists@colorremedies.com>
To: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
Cc: Martin Steigerwald <martin@lichtvoll.de>,
	Nikolay Borisov <nborisov@suse.com>, Wolf <wolf@wolfsden.cz>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Healthy amount of free space?
Date: Wed, 18 Jul 2018 07:07:57 -0600	[thread overview]
Message-ID: <CAJCQCtSZruKeM117EfQNQnEFuk_bswhhKnEnFVD2i7MHWU65RQ@mail.gmail.com> (raw)
In-Reply-To: <33396c10-33ef-b8ff-0041-c94d87c67722@gmail.com>

On Wed, Jul 18, 2018 at 6:35 AM, Austin S. Hemmelgarn
<ahferroin7@gmail.com> wrote:

> If you're doing a training presentation, it may be worth mentioning that
> preallocation with fallocate() does not behave the same on BTRFS as it does
> on other filesystems.  For example, the following sequence of commands:
>
>     fallocate -l X ./tmp
>     dd if=/dev/zero of=./tmp bs=1 count=X
>
> Will always work on ext4, XFS, and most other filesystems, for any value of
> X between zero and just below the total amount of free space on the
> filesystem.  On BTRFS though, it will reliably fail with ENOSPC for values
> of X that are greater than _half_ of the total amount of free space on the
> filesystem (actually, greater than just short of half).  In essence,
> preallocating space does not prevent COW semantics for the first write
> unless the file is marked NOCOW.

Is this a bug, or is it suboptimal behavior, or is it intentional?

And then I wonder what happens with XFS COW:

     fallocate -l X ./tmp
     cp --reflink ./tmp ./tmp2
     dd if=/dev/zero of=./tmp bs=1 count=X



-- 
Chris Murphy

  reply	other threads:[~2018-07-18 13:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 20:58 Healthy amount of free space? Wolf
2018-07-17  7:20 ` Nikolay Borisov
2018-07-17  8:02   ` Martin Steigerwald
2018-07-17  8:16     ` Nikolay Borisov
2018-07-17 17:54       ` Martin Steigerwald
2018-07-18 12:35         ` Austin S. Hemmelgarn
2018-07-18 13:07           ` Chris Murphy [this message]
2018-07-18 13:30             ` Austin S. Hemmelgarn
2018-07-18 17:04               ` Chris Murphy
2018-07-18 17:06                 ` Austin S. Hemmelgarn
2018-07-18 17:14                   ` Chris Murphy
2018-07-18 17:40                     ` Chris Murphy
2018-07-18 18:01                       ` Austin S. Hemmelgarn
2018-07-18 21:32                         ` Chris Murphy
2018-07-18 21:47                           ` Chris Murphy
2018-07-19 11:21                           ` Austin S. Hemmelgarn
2018-07-20  5:01               ` Andrei Borzenkov
2018-07-20 11:36                 ` Austin S. Hemmelgarn
2018-07-17 11:46 ` Austin S. Hemmelgarn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJCQCtSZruKeM117EfQNQnEFuk_bswhhKnEnFVD2i7MHWU65RQ@mail.gmail.com \
    --to=lists@colorremedies.com \
    --cc=ahferroin7@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=martin@lichtvoll.de \
    --cc=nborisov@suse.com \
    --cc=wolf@wolfsden.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).