]> rtime.felk.cvut.cz Git - linux-imx.git/commit
Btrfs: add orphan before truncating pagecache
authorJosef Bacik <jbacik@fusionio.com>
Mon, 7 Jan 2013 22:03:21 +0000 (17:03 -0500)
committerJosef Bacik <josef@toxicpanda.com>
Mon, 14 Jan 2013 18:52:52 +0000 (13:52 -0500)
commitf3fe820c20a1a36c790545184e734e78d61cd68d
tree852fcc814680ebcc272011dd4767222f5f8a3d88
parent72bcd99d450cb1dde8bf13c3b65fc5883b2a3893
Btrfs: add orphan before truncating pagecache

Running xfstests 83 in a loop would sometimes fail the fsck.  This happens
because if we invalidate a page that already has an ordered extent setup for
it we will complete the ordered extent ourselves, assuming that the truncate
will clean everything up.  The problem with this is there is plenty of time
for the truncate to fail after we've done this work.  So to fix this we need
to add the orphan item first to make sure the cleanup gets done properly,
and then we can truncate the pagecache and all that stuff and be safe.  This
fixes the btrfsck failures I was seeing while running 83 in a loop.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/inode.c