Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177526366
D61496.1794630582.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D61496.1794630582.diff
View Options
diff --git a/lib/libsys/fspacectl.2 b/lib/libsys/fspacectl.2
--- a/lib/libsys/fspacectl.2
+++ b/lib/libsys/fspacectl.2
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 25, 2021
+.Dd November 12, 2026
.Dt FSPACECTL 2
.Os
.Sh NAME
@@ -169,6 +169,8 @@
argument point outside the process' allocated address space.
.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 operation range.
.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_DEALLOCATE.9 b/share/man/man9/VOP_DEALLOCATE.9
--- a/share/man/man9/VOP_DEALLOCATE.9
+++ b/share/man/man9/VOP_DEALLOCATE.9
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 25, 2021
+.Dd November 12, 2026
.Dt VOP_DEALLOCATE 9
.Os
.Sh NAME
@@ -73,7 +73,12 @@
.Fa *len
are updated to reflect the portion of the range that
still needs to be zeroed/deallocated on return.
-Partial result is considered a successful operation.
+Partial result 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 .
For a non-partial successful completion,
.Fa *len
is updated to be the value 0, and
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
@@ -4005,7 +4005,7 @@
{
struct mount *mp;
void *rl_cookie;
- off_t off, len;
+ off_t len, off, olen;
int error;
#ifdef AUDIT
bool audited_vnode1 = false;
@@ -4046,10 +4046,23 @@
error = mac_vnode_check_write(active_cred, file_cred,
vp);
#endif
- if (error == 0)
+ if (error == 0) {
+ olen = len;
error = VOP_DEALLOCATE(vp, &off, &len, flags, ioflag,
cred);
+ /*
+ * A partial result is permitted, but each pass must
+ * make some progress or we would spin here forever.
+ */
+ if (error == 0 && len >= olen) {
+ KASSERT(0,
+ ("%s: no progress on vp %p (off %jd len %jd)",
+ __func__, vp, (intmax_t)off, (intmax_t)len));
+ error = EIO;
+ }
+ }
+
if ((ioflag & IO_NODELOCKED) == 0) {
VOP_UNLOCK(vp);
if (mp != NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 14, 4:29 AM (21 m, 51 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41715645
Default Alt Text
D61496.1794630582.diff (2 KB)
Attached To
Mode
D61496: vfs: fail VOP_DEALLOCATE passes that make no progress
Attached
Detach File
Event Timeline