summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/super.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2023-05-04 20:28:51 +0200
committerAndreas Gruenbacher <agruenba@redhat.com>2023-06-06 18:35:06 +0200
commitf9da18cd4616fbc9816347b7b2be188653786058 (patch)
treeb61e0707793852f1d34b0339a63c5db7bd078c70 /fs/gfs2/super.c
parentgfs2: Update rl_unlinked before releasing rgrp lock (diff)
downloadlinux-f9da18cd4616fbc9816347b7b2be188653786058.tar.xz
linux-f9da18cd4616fbc9816347b7b2be188653786058.zip
gfs2: Don't remember delete unless it's successful
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 <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r--fs/gfs2/super.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 925bd80d2625..3a7e7c31eb9c 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -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
@@ -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;
}