All of lore.kernel.org
 help / color / mirror / Atom feed
* [GFS2 PATCH 0/7] Fix glock deadlocks with deleted inodes
@ 2016-05-24 19:12 ` Bob Peterson
  0 siblings, 0 replies; 18+ messages in thread
From: Bob Peterson @ 2016-05-24 19:12 UTC (permalink / raw)
  To: cluster-devel, Alexander Viro, linux-fsdevel

I'm sending this to linux-fsdevel because one of the patches affects vfs.

GFS2 has a long-standing deadlock related to the transition of dinodes from
the Unlinked state to the Deleted state. The problem is that function
delete_work_func in glock.c called gfs2_lookup_by_inum, which locks the
inode glock before performing the rest of its checks, which means the lock
order is different from the normal lookups.

My original idea was to make delete_work_func call the normal lookup
function, and do away with the non-blocking lookups so they had the same
lock order. But we decided that was a bad idea. So the first two patches
revert the changes I had made earlier toward that end. The next five
patches implement a new design by Andreas Gruenbacher, which allows for
more flexibility in waiting for freeing inodes.

These missed transitions from unlinked to free also had another side-effect:
It often failed to acquire the lock and gave up, which meant that slowly
over time, the "df" value would get out of sync with "du." So it appeared
that the file system was more full than it was. (These unlinked dinodes
should, in theory, be reclaimed automatically, but they still threw the
numbers off, because the "unlinked" dinodes were not considered free space.)

This patch set has undergone rigorous testing that reliably recreated the
deadlock. Normally, the deadlock appeared in about an hour or two of
testing. With these patches, it's been running for weeks without a problem.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
Andreas Gruenbacher (5):
  GFS2: Remove superfluous assignment
  GFS2: No need for non-blocking gfs2_ilookup in delete_work_func
  vfs: Introduce prepare_wait_on_freeing_inode
  GFS2: Use non-blocking wait in gfs2_iget
  GFS2: Prevent deadlock in gfs2_lookup_by_inum

Bob Peterson (2):
  Revert "GFS2: Eliminate parameter non_block on gfs2_inode_lookup"
  Revert "GFS2: Don't filter out I_FREEING inodes anymore"

 fs/gfs2/dir.c        |   2 +-
 fs/gfs2/glock.c      |   4 +-
 fs/gfs2/inode.c      | 109 ++++++++++++++++++++++++++++++++++++++++++++++-----
 fs/gfs2/inode.h      |   8 +++-
 fs/gfs2/ops_fstype.c |   2 +-
 fs/inode.c           |  18 +++++++--
 include/linux/fs.h   |   1 +
 include/linux/wait.h |  21 +++++++---
 8 files changed, 142 insertions(+), 23 deletions(-)

-- 
2.5.5


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

end of thread, other threads:[~2016-05-24 21:58 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-24 19:12 [GFS2 PATCH 0/7] Fix glock deadlocks with deleted inodes Bob Peterson
2016-05-24 19:12 ` [Cluster-devel] " Bob Peterson
2016-05-24 19:12 ` [GFS2 PATCH 1/7] Revert "GFS2: Eliminate parameter non_block on gfs2_inode_lookup" Bob Peterson
2016-05-24 19:12   ` [Cluster-devel] " Bob Peterson
2016-05-24 19:12 ` [GFS2 PATCH 2/7] Revert "GFS2: Don't filter out I_FREEING inodes anymore" Bob Peterson
2016-05-24 19:12   ` [Cluster-devel] " Bob Peterson
2016-05-24 19:12 ` [GFS2 PATCH 3/7] GFS2: Remove superfluous assignment Bob Peterson
2016-05-24 19:12   ` [Cluster-devel] " Bob Peterson
2016-05-24 19:12 ` [GFS2 PATCH 4/7] GFS2: No need for non-blocking gfs2_ilookup in delete_work_func Bob Peterson
2016-05-24 19:12   ` [Cluster-devel] " Bob Peterson
2016-05-24 19:12 ` [GFS2 PATCH 5/7] vfs: Introduce prepare_wait_on_freeing_inode Bob Peterson
2016-05-24 19:12   ` [Cluster-devel] " Bob Peterson
2016-05-24 19:12 ` [GFS2 PATCH 6/7] GFS2: Use non-blocking wait in gfs2_iget Bob Peterson
2016-05-24 19:12   ` [Cluster-devel] " Bob Peterson
2016-05-24 19:12 ` [GFS2 PATCH 7/7] GFS2: Prevent deadlock in gfs2_lookup_by_inum Bob Peterson
2016-05-24 19:12   ` [Cluster-devel] " Bob Peterson
2016-05-24 21:58 ` [Cluster-devel] [GFS2 PATCH 0/7] Fix glock deadlocks with deleted inodes Andreas Gruenbacher
2016-05-24 21:58   ` Andreas Gruenbacher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.