diff --git a/lib/libsys/sendfile.2 b/lib/libsys/sendfile.2 index 07a563d5ef8..6000e3e9828 100644 --- a/lib/libsys/sendfile.2 +++ b/lib/libsys/sendfile.2 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 30, 2020 +.Dd June 24, 2025 .Dt SENDFILE 2 .Os .Sh NAME @@ -147,12 +147,6 @@ in a different context. .It Dv SF_NOCACHE The data sent to socket will not be cached by the virtual memory system, and will be freed directly to the pool of free pages. -.It Dv SF_SYNC -.Nm -sleeps until the network stack no longer references the VM pages -of the file, making subsequent modifications to it safe. -Please note that this is not a guarantee that the data has actually -been sent. .It Dv SF_USER_READAHEAD .Nm has some internal heuristics to do readahead when sending data. diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index 25c1f357dfd..17b53208157 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -798,7 +798,11 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, SFSTAT_INC(sf_syscalls); SFSTAT_ADD(sf_rhpages_requested, SF_READAHEAD(flags)); - if (flags & SF_SYNC) { + if (__predict_false(flags & SF_SYNC)) { + gone_in(16, "Warning! %s[%u] uses SF_SYNC sendfile(2) flag. " + "Please follow up to https://bugs.freebsd.org/" + "bugzilla/show_bug.cgi?id=287348. ", + td->td_proc->p_comm, td->td_proc->p_pid); sfs = malloc(sizeof(*sfs), M_SENDFILE, M_WAITOK | M_ZERO); mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); cv_init(&sfs->cv, "sendfile");