From: Miao Xie <miaox@cn.fujitsu.com>
To: Alex Lyakas <alex.btrfs@zadarastorage.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [RFC PATCH] Btrfs: fix full backref problem when inserting shared block reference
Date: Thu, 31 Jan 2013 10:42:49 +0800 [thread overview]
Message-ID: <5109DA29.9060601@cn.fujitsu.com> (raw)
In-Reply-To: <CAOcd+r0+K_hpCPYwdJzT_yyPg_1d+6YKiAU4+zvGKM3UjR1hAg@mail.gmail.com>
On Wed, 30 Jan 2013 20:23:22 +0200, Alex Lyakas wrote:
> Hi Miao,
> I was following this thread in the past, but I did not understand it
> fully, maybe you can explain?
>
>>>>> # mkfs.btrfs <partition>
>>>>> # mount <partition> <mnt>
>>>>> # cd <mnt>
>>>>> # for ((i=0;i<2400;i++)); do touch long_name_to_make_tree_more_deep$i; done
>>>>> # for ((i=0; i<4; i++))
>>>>> > do
>>>>> > mkdir $i
>>>>> > for ((j=0; j<200; j++))
>>>>> > do
>>>>> > btrfs sub snap . $i/$j
>>>>> > done &
>>>>> > done
>>>>
>>>> snapshot creation has a critical section. Once we copy a given root to
>>>> its snapshot, we're not allowed to change it until the transaction
>>>> is fully committed.
>
> Is the limitation that if we are creating a snap B of root A, and
> placing the root of B somewhere into the tree of A, then we can do
> this only once per transaction? Does this limitation still exist or
> your fix fixes it?
The limitation is the snapshoted subvolume can not be changed until the transaction
is committed. That is we can not insert anything(including the root of B and the
directory item/index of B) into the tree of A after snap B is created.
This limitation was fixed.
> Also, according to your reproducer, each "btrfs sub snap" will
> start/join a transaction, but then it will call
> btrfs_commit_transaction() and not btrfs_commit_transaction_async(),
> so it will wait until the transaction commits. So how it may happen
> that you create more than one snap in the same transaction with your
> reproducer?
run several tasks, and each task create snapshots repeatedly in its own
directory.
(If we create snapshots in the same directory, the i_mutex of the directory
will make the process serialized)
> The reason I am asking, is that I want to try to write code that
> creates several snaps in one transaction and only then commits. Should
> this be possible or there is some limitation, like I mentioned above?
As far as I know, it is possible, there is no limitation now.
Thanks
Miao
next prev parent reply other threads:[~2013-01-31 2:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-09 3:10 [RFC PATCH] Btrfs: fix full backref problem when inserting shared block reference Miao Xie
2012-08-09 6:48 ` David Sterba
2012-08-09 7:21 ` David Sterba
2012-08-09 7:50 ` Miao Xie
2012-08-10 10:38 ` Miao Xie
2012-08-21 6:24 ` Miao Xie
2012-08-09 12:23 ` Josef Bacik
2012-08-09 13:11 ` Chris Mason
2012-08-09 13:12 ` Josef Bacik
2012-08-09 13:16 ` Chris Mason
2012-08-09 18:04 ` Chris Mason
2012-08-10 10:38 ` Miao Xie
2012-08-10 11:56 ` Chris Mason
2013-01-30 18:23 ` Alex Lyakas
2013-01-31 2:42 ` Miao Xie [this message]
2013-01-31 13:06 ` Alex Lyakas
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=5109DA29.9060601@cn.fujitsu.com \
--to=miaox@cn.fujitsu.com \
--cc=alex.btrfs@zadarastorage.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.