]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
gfs2: Handle -EBUSY result of insert_inode_locked4
authorAndreas Gruenbacher <agruenba@redhat.com>
Sat, 5 Nov 2022 16:12:34 +0000 (17:12 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 5 Dec 2022 21:21:23 +0000 (22:21 +0100)
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 <agruenba@redhat.com>
fs/gfs2/inode.c

index c057f3bd475fb33377a2dab8daff49314810a9f3..9fbbc365a404cf86a24b9a5ac3dd76cd908e88b7 100644 (file)
@@ -734,8 +734,12 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
                goto fail_free_inode;
        gfs2_cancel_delete_work(io_gl);
 
+retry:
        error = insert_inode_locked4(inode, ip->i_no_addr, iget_test, &ip->i_no_addr);
-       BUG_ON(error);
+       if (error == -EBUSY)
+               goto retry;
+       if (error)
+               goto fail_gunlock2;
 
        error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT | GL_NOPID,
                                   &ip->i_iopen_gh);