Re: [PATCH] Btrfs: convert to add transaction protection for btrfs send

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Josef,

> 
> On 01/29/2014 10:32 AM, Wang Shilong wrote:
>> From: Wang Shilong <wangsl.fnst@xxxxxxxxxxxxxx>
>> 
>> I sent a patch to kick off transaction from btrfs send, however it gets
>> a regression that btrfs send try to search extent commit root without
>> transaction protection.
>> 
>> To fix this regression, we have two ideas:
>> 
>>  1. don't use extent commit root for sending.
>> 
>>  2. add transaction protection to use extent commit root safely.
>> 
>> Both approaches need transaction actually, however, the first approach
>> will add extent tree lock contention, so we'd better adopt the second
>> approach.
>> 
>> Luckily, now we only need transaction protection when iterating
>> extent root, the protection's *range* is smaller than before.
> So what is the problem exactly?  How does it show up and what are you doing to make it happen?  I'd really like to kill the transaction taking completely in the send path so I'd like to know what is going wrong so we can either take the extent commit semaphore and be satisfied that is ok or come up with a different solution.  Thanks,

See in find_extent_clone(), we have to walk backrefs  while we have to search extent tree!
i was thinking to kick off transaction for initial  full send, however, we need to consider ref links even
in the initial send.

It is easy to trigger problems like the following steps:

# mkfs.btrfs -f /dev/sda8
# mount /dev/sda8 /mnt
# dd if=/dev/zero of=/mnt/data bs=4k count=102400 oflag=direct
# btrfs sub snapshot -r /mnt /mnt/snap
# btrfs send /mnt/snap -f /mnt/send_file &
# btrfs sub snapshot /mnt/snap /mnt/snap_1

Feel free to correct me if i miss something here^_^(As i sometimes made some mistakes).

Thanks,
Wang
> ,
> Josef

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux