diff --git a/fs/libfs.c b/fs/libfs.c index 51f5b4651986..d883fc90c6f3 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -294,8 +294,8 @@ int simple_offset_add(struct offset_ctx *octx, struct dentry *dentry) ret = mtree_alloc_cyclic(&octx->mt, &offset, dentry, DIR_OFFSET_MIN, DIR_OFFSET_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;