-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
rhel-9.6.z, rhel-10.0.z
-
None
-
No
-
Low
-
None
-
None
-
False
-
False
-
-
None
-
None
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
None
What were you trying to do that didn't work?
If the available disk space is insufficient to allocate a new directory block, but files are still holding preallocated space, creating a symlink will fail with ENOENT, rather than causing release
Creating a file or subdirectory under the same condition will cause release of the preallocated file space, so ENOENT only occurs when the disk is truly full.
After a period of time, the preallocated space may be released, at which point creating a symlink will again succeed.
What is the impact of this issue to you?
Temporary inability to create symlinks when disk is nearly full, due to preallocations.
Please provide the package NVR for which the bug is seen:
RHEL 10 kernels, RHEL 9 kernels
How reproducible is this bug?:
easy
Steps to reproduce
the attached program alternately:
- creates a file, writes to it, and closes it; and
- creates a symlink to that file; if the symlink creation fails, delay briefly and reattempt symlink.
The file write size and count generally result in preallocated space.
dfd = open("mnt", O_RDONLY|O_DIRECTORY) i = 0 while (42) { sprintf(filename, "file%06d", i) fd = openat(dfd, filename, O_CREAT|O_TRUNC|O_RDWR, 0644) for (j = 0 ; j < 5 ; j++) { write(fd, buf, 64KiB) } close(fd) sprintf(linkname, "link%06d", i) while ((symlinkat(dfd, filename, dfd, linkname)) < 0) { usleep(); } i = i++ }
Expected results
both file and symlink creation succeed until full filesystem prevents allocation of a directory block; preallocated space is released if needed to satisfy the symlink creation
Actual results
symlink creation does not recover preallocated space, so symlinkat() fails temporarily, until preallocated space is released, then symlinkat succeeds again