]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: checkpoint appending truncate log transaction before flushing
authorChangwei Ge <gechangwei@live.cn>
Mon, 23 Sep 2019 22:33:40 +0000 (15:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 Sep 2019 22:54:07 +0000 (15:54 -0700)
commit2cfdd3e1088b715ccc3e88b30a975b326b9a0b34
tree80119ce1cfdcc2cb64c22446837c5a7175bea6d0
parent3ebb6ad12ea26825fc5dd2f1dea954cc4ca66b96
ocfs2: checkpoint appending truncate log transaction before flushing

Appending truncate log(TA) and and flushing truncate log(TF) are two
separated transactions.  They can be both committed but not checkpointed.
If crash occurs then, both transaction will be replayed with several
already released to global bitmap clusters.  Then truncate log will be
replayed resulting in cluster double free.

To reproduce this issue, just crash the host while punching hole to files.

Signed-off-by: Changwei Ge <gechangwei@live.cn>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/alloc.c