Skip to content

Commit 1072b3a

Browse files
author
Andreas Gruenbacher
committed
gfs2: Initialize gl_no_formal_ino earlier
Set gl_no_formal_ino of the iopen glock to the generation of the associated inode (ip->i_no_formal_ino) as soon as that value is known. This saves us from setting it later, possibly repeatedly, when queuing GLF_VERIFY_DELETE work. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 820ce8e commit 1072b3a

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

fs/gfs2/glock.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,6 @@ static bool gfs2_try_evict(struct gfs2_glock *gl)
980980
ip = NULL;
981981
spin_unlock(&gl->gl_lockref.lock);
982982
if (ip) {
983-
gl->gl_no_formal_ino = ip->i_no_formal_ino;
984983
set_bit(GIF_DEFERRED_DELETE, &ip->i_flags);
985984
d_prune_aliases(&ip->i_inode);
986985
iput(&ip->i_inode);

fs/gfs2/glops.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,11 +494,18 @@ int gfs2_inode_refresh(struct gfs2_inode *ip)
494494
static int inode_go_instantiate(struct gfs2_glock *gl)
495495
{
496496
struct gfs2_inode *ip = gl->gl_object;
497+
struct gfs2_glock *io_gl;
498+
int error;
497499

498500
if (!ip) /* no inode to populate - read it in later */
499501
return 0;
500502

501-
return gfs2_inode_refresh(ip);
503+
error = gfs2_inode_refresh(ip);
504+
if (error)
505+
return error;
506+
io_gl = ip->i_iopen_gh.gh_gl;
507+
io_gl->gl_no_formal_ino = ip->i_no_formal_ino;
508+
return 0;
502509
}
503510

504511
static int inode_go_held(struct gfs2_holder *gh)

fs/gfs2/inode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
750750
if (error)
751751
goto fail_free_inode;
752752
gfs2_cancel_delete_work(io_gl);
753+
io_gl->gl_no_formal_ino = ip->i_no_formal_ino;
753754

754755
retry:
755756
error = insert_inode_locked4(inode, ip->i_no_addr, iget_test, &ip->i_no_addr);

0 commit comments

Comments
 (0)