Skip to content
Unverified Commit 903dc9c4 authored by Chuck Lever's avatar Chuck Lever Committed by Christian Brauner
Browse files

libfs: Return ENOSPC when the directory offset range is exhausted



Testing shows that the EBUSY error return from mtree_alloc_cyclic()
leaks into user space. The ERRORS section of "man creat(2)" says:

>	EBUSY	O_EXCL was specified in flags and pathname refers
>		to a block device that is in use by the system
>		(e.g., it is mounted).

ENOSPC is closer to what applications expect in this situation.

Note that the normal range of simple directory offset values is
2..2^63, so hitting this error is going to be rare to impossible.

Fixes: 6faddda6 ("libfs: Add directory operations for stable offsets")
Cc: stable@vger.kernel.org # v6.9+
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatarYang Erkun <yangerkun@huawei.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Link: https://lore.kernel.org/r/20241228175522.1854234-2-cel@kernel.org


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 40384c84
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment