]> git.baikalelectronics.ru Git - kernel.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)
commit308cab36a6d698fa9c426837aabac6cadc3c3ce6
tree852fcc814680ebcc272011dd4767222f5f8a3d88
parent3e4b413e68a463fd61a569745c59cc9c401f217d
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