Skip to content

Commit

Permalink
gfs2: Don't remember delete unless it's successful
Browse files Browse the repository at this point in the history
This patch changes function evict_unlinked_inode so it does not call
gfs2_inode_remember_delete until it gets a good return code from
gfs2_dinode_dealloc.

Signed-off-by: Bob Peterson <[email protected]>
Signed-off-by: Andreas Gruenbacher <[email protected]>
  • Loading branch information
AstralBob authored and Andreas Gruenbacher committed Jun 6, 2023
1 parent 17a5934 commit f9da18c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/gfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1332,9 +1332,6 @@ static int evict_unlinked_inode(struct inode *inode)
goto out;
}

if (ip->i_gl)
gfs2_inode_remember_delete(ip->i_gl, ip->i_no_formal_ino);

/*
* As soon as we clear the bitmap for the dinode, gfs2_create_inode()
* can get called to recreate it, or even gfs2_inode_lookup() if the
Expand All @@ -1348,6 +1345,9 @@ static int evict_unlinked_inode(struct inode *inode)
*/

ret = gfs2_dinode_dealloc(ip);
if (!ret && ip->i_gl)
gfs2_inode_remember_delete(ip->i_gl, ip->i_no_formal_ino);

out:
return ret;
}
Expand Down

0 comments on commit f9da18c

Please sign in to comment.