From nobody Fri Jul 4 05:15:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYMK65kjWz60lLY; Fri, 04 Jul 2025 05:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bYMK64f5dz41Xd; Fri, 04 Jul 2025 05:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751606122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l489w2A4JqTJIrhff6LHpbO35PHPilUia+Aev0dypfU=; b=GzFo7aYZs4t+xxg9hjn9odKU/3VJwdKc0CLj6iQEvVyiUmdnHNZ5UwQI8zgKQ6NpPtxe/R BsW1uZdn9wQgH0qUEq9e+rm0Ekh6gbO49RZSPAELwhvpkDtqzXj9WTEMdd5kNT53GNWmux rTWO6VAd47graRVKkhkLFTcU6x5SfQuAwh2B2ol4aE6PeMtLyVg71RY8Bwg1ZM7Ac2HRlK SD5ZBg+j8KOTpceNJKLCwhreg60a/yaSnbwMQiTfz2MYwwg7UnNcXVWDe7awqtutTDNWE0 HCS+sy3NDol/dUEH/AJRmALhBzox4/688r53Isn4VJ2Gh2XlkaNQ5vQsj8YBOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751606122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l489w2A4JqTJIrhff6LHpbO35PHPilUia+Aev0dypfU=; b=IgZ+3m8YbnGBFqI1A+Evf/gZ7axejaj8eIEYrUdU78Hep8vxS7uE7HGbnj640pw2DL/Wsp jAFVv0IJrr3DbdmAFX3NWxJZq69bLIvWF5k1Y7LaJchecBBXk9DUyvIRt7P4FO3c5ocB3o XLJDaFPMJhsTowqtFlWrC0RiNe6FPwhkNZRNr3MwjtcE2JduI6r1R+unRmr/pBl4pElokS DGVFqgOBG0Xny2Hk4vNXjf7J7LjDHvr9nR4Np6uXewcJ3RUkqOkSrSwW1AYxCxC6yvIZ6+ FQHyaW5GfRGayh3ZlSAA21uiJX/b/T76CQ45bWEoQT4A/rwUF3ECP+AVHkJhsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751606122; a=rsa-sha256; cv=none; b=R2tNLMT0f+oEwAVAbJuR7bL8ciogwnzt+85/PUWiCpk+lvp/HmXSLJ6quF1BEsPjvUTbLp /fWp1awOZiCK78mhdX5uT2fZFRyuETJXt77jy3IS4JaJFP/bfjrppQKcYKFUVFm6Rwe60e XLeHj71RZH+1nZgE450aHsvxleDEMAimu9qvZPpiIRcMJyNztlJCqH0IEMCTLh/2ENqKTH UDuGEzaYMW/4YeACDzVObkZGnCIDiWgsE9xcVBLU23CxXO3EnqjwBpmrb1U6fACkJJaLGd bd40sQRDSJxpBKy6HmcxppnHM+o6LJrAg9+WdMrjtFiTgtO83905C5xgIxn2Yg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYMK64DnWzcsV; Fri, 04 Jul 2025 05:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5645FMQ4087667; Fri, 4 Jul 2025 05:15:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5645FMm5087665; Fri, 4 Jul 2025 05:15:22 GMT (envelope-from git) Date: Fri, 4 Jul 2025 05:15:22 GMT Message-Id: <202507040515.5645FMm5087665@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: bd173a540c0e - main - write.2: Add EINVAL to ERRORS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd173a540c0ead4881b0866b721955440e3b96fe Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=bd173a540c0ead4881b0866b721955440e3b96fe commit bd173a540c0ead4881b0866b721955440e3b96fe Author: Felix Johnson AuthorDate: 2025-07-03 20:27:22 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 05:14:19 +0000 write.2: Add EINVAL to ERRORS Since phk rewrote the block layer ~2 decades ago, write(2) can return EINVAL when the target is a block device and nbytes, the write size, is not a multiple of the sector's block size. From the original PR: When coming from Linux, people are surprised by the fact that write(2) to a device must be aligned to block size. Writing a non-aligned block onto a raw device is a case where EINVAL is also returned but the manpage does not mention this. MFC after: 3 days PR: 227185 Reported by: riggs Reviewed by: imp, Pau Amma Differential Revision: https://reviews.freebsd.org/D51138 --- lib/libsys/write.2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libsys/write.2 b/lib/libsys/write.2 index 7ff1c42715d6..d2ff41ceead9 100644 --- a/lib/libsys/write.2 +++ b/lib/libsys/write.2 @@ -195,6 +195,9 @@ is greater than if the sysctl .Va debug.iosize_max_clamp is non-zero). +.It Bq Er EINVAL +The file descriptor refers to a raw device, and the write +offset or size is not a multiple of the device's block size. .It Bq Er EINTEGRITY The backing store for .Fa fd