Skip to content

Commit 41a8e04

Browse files
author
Andreas Gruenbacher
committed
gfs2: skip if we cannot defer delete
In gfs2_evict_inode(), in the unlikely case that we cannot defer deleting the inode, it is not safe to fall back to deleting the inode; the only valid choice we have is to skip the delete. In addition, in evict_should_delete(), if we cannot lock the inode glock exclusively, we are in a bad enough state that skipping the delete is likely a better choice than trying to recover from the failure later. Fixes: c5b7a24 ("gfs2: Only defer deletes when we have an iopen glock") Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 79fe790 commit 41a8e04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/gfs2/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ static enum evict_behavior evict_should_delete(struct inode *inode,
13401340
/* Must not read inode block until block type has been verified */
13411341
ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, gh);
13421342
if (unlikely(ret))
1343-
return EVICT_SHOULD_DEFER_DELETE;
1343+
return EVICT_SHOULD_SKIP_DELETE;
13441344

13451345
if (gfs2_inode_already_deleted(ip->i_gl, ip->i_no_formal_ino))
13461346
return EVICT_SHOULD_SKIP_DELETE;
@@ -1499,7 +1499,7 @@ static void gfs2_evict_inode(struct inode *inode)
14991499
gfs2_glock_put(io_gl);
15001500
goto out;
15011501
}
1502-
behavior = EVICT_SHOULD_DELETE;
1502+
behavior = EVICT_SHOULD_SKIP_DELETE;
15031503
}
15041504
if (behavior == EVICT_SHOULD_DELETE)
15051505
ret = evict_unlinked_inode(inode);

0 commit comments

Comments
 (0)