linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Bob Peterson <rpeterso@redhat.com>,
	Steven Whitehouse <swhiteho@redhat.com>
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
	cluster-devel@redhat.com, linux-fsdevel@vger.kernel.org
Subject: [PATCH 0/7] Allow lock dropping before waiting on inodes being freed
Date: Fri, 13 May 2016 19:42:22 +0200	[thread overview]
Message-ID: <1463161349-547-1-git-send-email-agruenba@redhat.com> (raw)

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


             reply	other threads:[~2016-05-13 17:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 17:42 Andreas Gruenbacher [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463161349-547-1-git-send-email-agruenba@redhat.com \
    --to=agruenba@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rpeterso@redhat.com \
    --cc=swhiteho@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).