diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 46a6e97cd930..8db92a36194a 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -982,6 +982,13 @@ static void gfs2_try_evict(struct gfs2_glock *gl) if (ip && !igrab(&ip->i_inode)) ip = NULL; spin_unlock(&gl->gl_lockref.lock); + if (ip) { + wait_on_inode(&ip->i_inode); + if (is_bad_inode(&ip->i_inode)) { + iput(&ip->i_inode); + ip = NULL; + } + } if (ip) { set_bit(GIF_DEFER_DELETE, &ip->i_flags); d_prune_aliases(&ip->i_inode);