Page MenuHomeFreeBSD

D61497.1794630514.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D61497.1794630514.diff

diff --git a/lib/libsys/posix_fallocate.2 b/lib/libsys/posix_fallocate.2
--- a/lib/libsys/posix_fallocate.2
+++ b/lib/libsys/posix_fallocate.2
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd November 2, 2025
+.Dd November 12, 2026
.Dt POSIX_FALLOCATE 2
.Os
.Sh NAME
@@ -108,6 +108,8 @@
argument was less than zero.
.It Bq Er EIO
An I/O error occurred while reading from or writing to a file system.
+.It Bq Er EIO
+The file system failed to make progress on the requested allocation.
.It Bq Er EINTEGRITY
Corrupted data was detected while reading from the file system.
.It Bq Er ENODEV
diff --git a/share/man/man9/VOP_ALLOCATE.9 b/share/man/man9/VOP_ALLOCATE.9
--- a/share/man/man9/VOP_ALLOCATE.9
+++ b/share/man/man9/VOP_ALLOCATE.9
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd November 8, 2021
+.Dd November 12, 2026
.Dt VOP_ALLOCATE 9
.Os
.Sh NAME
@@ -68,7 +68,12 @@
.Fa len
arguments are updated to reflect the portion of the range that
still needs to be allocated on return.
-A partial allocation is considered a successful operation.
+A partial allocation is considered a successful operation, provided that
+some progress was made:
+a successful return must decrease
+.Fa *len ,
+or the caller will fail the request with
+.Er EIO .
The file's contents are not changed.
.Sh LOCKS
The file should be exclusively locked on entry and will still be locked on exit.
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -3991,7 +3991,19 @@
}
if (error != 0 || len == 0)
break;
- KASSERT(olen > len, ("Iteration did not make progress?"));
+
+ /*
+ * A partial result is permitted, but each pass must make some
+ * progress or we would spin here forever.
+ */
+ if (len >= olen) {
+ KASSERT(0,
+ ("%s: no progress on vp %p (off %jd len %jd)",
+ __func__, vp, (intmax_t)offset, (intmax_t)len));
+ error = EIO;
+ break;
+ }
+
maybe_yield();
}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 14, 4:28 AM (48 m, 48 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41715702
Default Alt Text
D61497.1794630514.diff (2 KB)

Event Timeline