linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Fix delalloc inodes leaking on btrfs unmount
@ 2018-04-27  9:21 Nikolay Borisov
  2018-04-27  9:21 ` [PATCH 1/5] btrfs: Unexport btrfs_alloc_delalloc_work Nikolay Borisov
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Nikolay Borisov @ 2018-04-27  9:21 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

After investigating crashes on generic/176 it turned that the culprit in fact
is the random failure induced by generic/019. As it happens, if on unmount the 
filesystem is in BTRFS_FS_STATE_ERROR then btrfs_error_commit_super is called. 
This unveiled 2 bugs:
 1. btrfs_destroy_delalloc_inodes's implementation was completely bogus, since
 it only called btrfs_invalidate_inodes which only pruned dentries and didn't 
 do anything to free any inodes with pending delalloc bytes. Once this is fixed 
 with the use of invalide_inode_pages2 the second bug transpired. 
 2. The last call ot run_delayed_iputs is made before btrfs_cleanup_transaction
 is called. The latter in turn could queue up more delayed iputs resulting from 
 invalidates_inode_pages2. 

This series fixes the problem by first fixing btrfs_destroy_delalloc_inode to 
properly cleanup delalloc inodes and as a result cleans up the code a bit. 

I've given it a good bashing through xfstest (4 full xfstest cycles + 100 
iterations of generic/475 since it was hitting some early assertion failures,
which are fixed in the final version) so am pretty confident in the change. 

Nikolay Borisov (5):
  btrfs: Unexport btrfs_alloc_delalloc_work
  btrfs: Split btrfs_del_delalloc_inode into 2 functions
  btrfs: Add assert in __btrfs_del_delalloc_inode
  btrfs: Fix delalloc inodes invalidation during transaction abort
  btrfs: Unexport and rename btrfs_invalidate_inodes

 fs/btrfs/ctree.h   |  12 +----
 fs/btrfs/disk-io.c |  22 ++++----
 fs/btrfs/inode.c   | 152 ++++++++++++++++++++++++++++++-----------------------
 3 files changed, 99 insertions(+), 87 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-05-16 15:39 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-27  9:21 [PATCH 0/5] Fix delalloc inodes leaking on btrfs unmount Nikolay Borisov
2018-04-27  9:21 ` [PATCH 1/5] btrfs: Unexport btrfs_alloc_delalloc_work Nikolay Borisov
2018-04-27  9:21 ` [PATCH 2/5] btrfs: Split btrfs_del_delalloc_inode into 2 functions Nikolay Borisov
2018-05-11  5:44   ` Anand Jain
2018-05-11  8:39     ` Nikolay Borisov
2018-05-16 15:27       ` David Sterba
2018-04-27  9:21 ` [PATCH 3/5] btrfs: Add assert in __btrfs_del_delalloc_inode Nikolay Borisov
2018-04-27  9:21 ` [PATCH 4/5] btrfs: Fix delalloc inodes invalidation during transaction abort Nikolay Borisov
2018-05-10 15:35   ` David Sterba
2018-04-27  9:21 ` [PATCH 5/5] btrfs: Unexport and rename btrfs_invalidate_inodes Nikolay Borisov
2018-04-27 11:36   ` [PATCH v2] " Nikolay Borisov
2018-04-28 16:33     ` kbuild test robot
2018-04-28 16:44     ` kbuild test robot
2018-04-28 18:04     ` kbuild test robot
2018-05-11  5:38     ` Anand Jain
2018-05-01 14:02 ` [PATCH 0/5] Fix delalloc inodes leaking on btrfs unmount David Sterba
2018-05-16 15:36   ` David Sterba
2018-05-07 22:58 ` David Sterba
2018-05-08  5:16   ` Nikolay Borisov
2018-05-08 10:41     ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).