]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: just wait or commit our own log sub-transaction
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 20 Feb 2014 10:08:59 +0000 (18:08 +0800)
committerJosef Bacik <jbacik@fb.com>
Mon, 10 Mar 2014 19:16:43 +0000 (15:16 -0400)
commitc19c4760727f0d54266308cb81ff9ec3b38b5476
tree1cc86b5bc4a40a9ffc568ae0dbfd78bae4360c54
parent5a3126a6228ca2ed84023a3149359efa14a1f8eb
Btrfs: just wait or commit our own log sub-transaction

We might commit the log sub-transaction which didn't contain the metadata we
logged. It was because we didn't record the log transid and just select
the current log sub-transaction to commit, but the right one might be
committed by the other task already. Actually, we needn't do anything
and it is safe that we go back directly in this case.

This patch improves the log sync by the above idea. We record the transid
of the log sub-transaction in which we log the metadata, and the transid
of the log sub-transaction we have committed. If the committed transid
is >= the transid we record when logging the metadata, we just go back.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/tree-log.c
fs/btrfs/tree-log.h