From: Jan Schmidt <list.btrfs@jan-o-sch.net>
To: Alex Lyakas <alex.btrfs@zadarastorage.com>
Cc: Chen Yang <chenyang.fnst@cn.fujitsu.com>,
Alexander Block <ablock84@googlemail.com>,
linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs/send: sparse and pre-allocated file support for, btrfs-send mechanism
Date: Thu, 24 Jan 2013 18:13:31 +0100 [thread overview]
Message-ID: <51016BBB.8060307@jan-o-sch.net> (raw)
In-Reply-To: <CAOcd+r0hMRic8=fXNmUSbifAXwnQER8wCkj=mHSBGpQ7fM=LDA@mail.gmail.com>
Hi Alex,
On Thu, January 24, 2013 at 09:53 (+0100), Alex Lyakas wrote:
> Looking, for example, here:
> http://man7.org/linux/man-pages/man2/fallocate.2.html
>
> "Allocating disk space
> The default operation (i.e., mode is zero) of fallocate() allocates
> and initializes to zero the disk space within the range specified by
> offset and len."
>
> "Deallocating file space
> Specifying the FALLOC_FL_PUNCH_HOLE flag (available since Linux
> 2.6.38) in mode deallocates space (i.e., creates a hole) in the byte
> range starting at offset and continuing for len bytes. Within the
> specified range, partial file system blocks are zeroed, and whole file
> system blocks are removed from the file."
>
> These are clearly two different modes of operation, and I don't think
> you or me can decide otherwise, at this point.
>
> However, I may be not knowledgeable enough to confirm this.
> Jan/Alexander, can you perhaps comment on this?
We don't transfer the metadata itself and that's for good reason. The data
should look alike from a user's point of view where possible. In places where we
have no good solution, we make compromises (inode numbers come to mind).
So, as a general rule: If possible with reasonable effort, I like to keep as
much of the structure as possible. Therefore, I'd rather not see a sparse
detector in any receiver out there; if it's sparse, send it as sparse, and if
it's on disk, send it as zeros on disk.
Handling of preallocated space with this rule is, well, arguable. For me, such
space is more on disk than it's not. Applications preallocating space might do
so for a good reason, and I would not treat those blocks as if they were holes
for send and receive.
-Jan
next prev parent reply other threads:[~2013-01-24 17:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <50FF58BC.7090604@cn.fujitsu.com>
2013-01-23 11:04 ` [PATCH] Btrfs/send: sparse and pre-allocated file support for, btrfs-send mechanism Chen Yang
2013-01-23 11:56 ` Alex Lyakas
[not found] ` <51009455.7040005@cn.fujitsu.com>
2013-01-24 8:53 ` Alex Lyakas
2013-01-24 11:39 ` Miao Xie
2013-01-24 11:58 ` Hugo Mills
2013-01-24 12:13 ` Miao Xie
2013-01-24 12:41 ` Hugo Mills
2013-01-24 17:13 ` Jan Schmidt [this message]
2013-01-24 18:06 ` Alex Lyakas
2013-01-25 8:56 ` Jan Schmidt
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=51016BBB.8060307@jan-o-sch.net \
--to=list.btrfs@jan-o-sch.net \
--cc=ablock84@googlemail.com \
--cc=alex.btrfs@zadarastorage.com \
--cc=chenyang.fnst@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.