Skip to content

Commit 4ec3c19

Browse files
author
Andreas Gruenbacher
committed
gfs2: Handle -EBUSY result of insert_inode_locked4
When creating a new inode, there is a small chance that an inode lookup for a previous version of the same inode is still in progress. In that case, that previous lookup will eventually fail, but we may still need to retry here. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 38552ff commit 4ec3c19

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/gfs2/inode.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,12 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
734734
goto fail_free_inode;
735735
gfs2_cancel_delete_work(io_gl);
736736

737+
retry:
737738
error = insert_inode_locked4(inode, ip->i_no_addr, iget_test, &ip->i_no_addr);
738-
BUG_ON(error);
739+
if (error == -EBUSY)
740+
goto retry;
741+
if (error)
742+
goto fail_gunlock2;
739743

740744
error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT | GL_NOPID,
741745
&ip->i_iopen_gh);

0 commit comments

Comments
 (0)