diff --git a/fs/libfs.c b/fs/libfs.c index 46966fd8bcf9..f803d440ce39 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -288,8 +288,8 @@ int simple_offset_add(struct offset_ctx *octx, struct dentry *dentry) ret = mtree_alloc_cyclic(&octx->mt, &offset, dentry, DIR_OFFSET_MIN, LONG_MAX, &octx->next_offset, GFP_KERNEL); - if (ret < 0) - return ret; + if (unlikely(ret < 0)) + return ret == -EBUSY ? -ENOSPC : ret; offset_set(dentry, offset); return 0;