linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Allow lock dropping before waiting on inodes being freed
@ 2016-05-13 17:42 Andreas Gruenbacher
  2016-05-13 17:42 ` [PATCH 1/7] Revert "GFS2: Eliminate parameter non_block on gfs2_inode_lookup" Andreas Gruenbacher
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Andreas Gruenbacher @ 2016-05-13 17:42 UTC (permalink / raw)
  To: Alexander Viro, Bob Peterson, Steven Whitehouse
  Cc: Andreas Gruenbacher, cluster-devel, linux-fsdevel

This patch set my Bob and me avoids a deadlock in gfs2 when an inode is being
freed: normally, when find_inode finds an inode in I_FREEING or I_WILL_FREE
state, it waits for the inode to go away before returning
(__wait_on_freeing_inode).  Freeing an inode on gfs2 requires taking the
inode's glock.  However, in gfs2_lookup_by_inum, we need to be holding the
inode glock while doing lookups, so we can deadlock with processes concurrently
freeing inodes.

This patch set allows gfs2_lookup_by_inum to drop the inode glock before
waiting for inodes to go away.  We could try non-blocking lookups and wait for
an arbitrary amount of time before retrying the lookup instead as well, but
waiting for the actual event (i.e., the inode being freed to likely have
disappeared) makes more sense.

Thanks,
Andreas

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] 10+ messages in thread

end of thread, other threads:[~2016-05-31 16:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-13 17:42 [PATCH 0/7] Allow lock dropping before waiting on inodes being freed Andreas Gruenbacher
2016-05-13 17:42 ` [PATCH 1/7] Revert "GFS2: Eliminate parameter non_block on gfs2_inode_lookup" Andreas Gruenbacher
2016-05-13 17:42 ` [PATCH 2/7] Revert "GFS2: Don't filter out I_FREEING inodes anymore" Andreas Gruenbacher
2016-05-13 17:42 ` [PATCH 3/7] GFS2: Remove superfluous assignment Andreas Gruenbacher
2016-05-13 17:42 ` [PATCH 4/7] GFS2: No need for non-blocking gfs2_ilookup in delete_work_func Andreas Gruenbacher
2016-05-13 17:42 ` [PATCH 5/7] vfs: Introduce prepare_wait_on_freeing_inode Andreas Gruenbacher
2016-05-13 17:42 ` [PATCH 6/7] GFS2: Use non-blocking wait in gfs2_iget Andreas Gruenbacher
2016-05-13 17:42 ` [PATCH 7/7] GFS2: Prevent deadlock in gfs2_lookup_by_inum Andreas Gruenbacher
2016-05-16 12:14 ` [PATCH 0/7] Allow lock dropping before waiting on inodes being freed Andreas Gruenbacher
2016-05-31 16:45 ` Bob Peterson

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).