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?

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?

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?

Thanks for your help,
Alex.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to