diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2022-11-05 17:12:34 +0100 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2022-12-05 22:21:23 +0100 |
commit | 4ec3c19d058f7391ec631b8a1b0a690422b246a9 (patch) | |
tree | 63daf90428b577c90b1e17dbcdf087ce8fb8b319 /fs/gfs2 | |
parent | 38552ff676f072e7d15c5e0a877fda613e57ed2d (diff) |
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 <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/inode.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index c057f3bd475f..9fbbc365a404 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -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); |