From nobody Fri Aug 26 15:16:47 2022 X-Original-To: dev-commits-src-main@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 4MDk2R3XQ9z4ZJTT; Fri, 26 Aug 2022 15:16:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MDk2R33Mjz3FB7; Fri, 26 Aug 2022 15:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661527007; 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=ZbGC3E+Ev3zD42eQwhAhkm9CwAQy5WEv0wCXMFh1Epw=; b=xSJq7yghFI9478cSYyz93CTjfGBwkFK9q/thIa9OHub1ii9AJG+KgYwuv5sbuq8zF12B+e bJONr50xnD0D57NSv7Hvq4zgbek7pOXFi15uOnlyQjCto2lBpBkyjCczTx+MYuyEEWtqDM tNcwQTfUK2LRt9kerGdFHvIKNS8KBOPOu5kYDyB+lRBJHVFwJWk4rOP0S2ZGPp7wHM19SY hKGLzUNzozfP1ZIRu8NkPz3vXoTAbD+YlX2muu91ScSFJvQhk32G1m/5nL3WNbm57giA4L j+NgiJLz2U+rk75PqxjoWukxNYSr80tFsJM7I8Xe/+iApxlnGHpf6pHqLqfPqg== 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 4MDk2R209SzRBy; Fri, 26 Aug 2022 15:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27QFGlvB007468; Fri, 26 Aug 2022 15:16:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27QFGlpY007467; Fri, 26 Aug 2022 15:16:47 GMT (envelope-from git) Date: Fri, 26 Aug 2022 15:16:47 GMT Message-Id: <202208261516.27QFGlpY007467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 7c04ca1fad67 - main - sockets: for stat(2) on a socket don't report hiwat as block size List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7c04ca1fad673f085678faadd10342f82185e829 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661527007; 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=ZbGC3E+Ev3zD42eQwhAhkm9CwAQy5WEv0wCXMFh1Epw=; b=FucfFkBhUXquWaKqNcgJaHruMvX7+EURC0NM2SOrUev5Odj1i1wQl2uy4M2uvwWHOpLaAp ippUiKEf/iaCu7S4CFq6TVQnVnFTWpHOKvsP939HF0XJJN8PfmVfn5zeOHcVusQsSQA/DX zPuXSKQp5FJKCkZWUhZ8Ppo9yNx5qD0u4zWJzGn6DbQQ4PP8exwqL2DrjhSPR6hmvqr8qs 24cZbgtLV7vAiS6ZdGrZT7eCd/58VQKDdLtg5NgMj7EftfdzIRwZ9fsp8mJLdB0gWcT3t+ mE8vE+9lWeCME26EwRc9tSzD19ZfxyBO0YF2X9hhI0HvLn+52nfpFJpqFpEEfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661527007; a=rsa-sha256; cv=none; b=XH9Mlg3Sb7wEDTEIexrGNVmUBAbZJGohatrLOeD873FHtsMyWXTX0yqv+WSsN6bB5D88NM GVn1Jqc4KbAwXMHC1IIKUeF2HEmlJW2SsR7pEpotCb//y92sLA4k/Q9dQ2yhtteA0jKJ6J yXRMzXpEqT51Ildz3x8jzdHU3OqwVuMiQYf5OtyAdXrvWXH7uQAWqiQByjzxhns+NFrANz /X9+exjzegBfZ+v2ApYu/nkxCQWaCWsGWxLPJkxs0HKhZmyqExqXjWQZ6vYBOxuUm6VqQ6 y23AcWS21BqIX1MSYMj2IuG2jXx0pKHD+nZ4kfiairKKJ/82RlXMsH4fV1RQ+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=7c04ca1fad673f085678faadd10342f82185e829 commit 7c04ca1fad673f085678faadd10342f82185e829 Author: Gleb Smirnoff AuthorDate: 2022-08-26 15:16:15 +0000 Commit: Gleb Smirnoff CommitDate: 2022-08-26 15:16:15 +0000 sockets: for stat(2) on a socket don't report hiwat as block size The code appeared in d8392c6c39eb with not good explanation. It is very unlikely any software in the world needs that. Differential revision: https://reviews.freebsd.org/D36283 --- sys/kern/sys_socket.c | 3 ++- sys/kern/uipc_domain.c | 13 ------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 5b8aadc12e08..5c10e2217686 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -335,7 +335,8 @@ soo_stat(struct file *fp, struct stat *ub, struct ucred *active_cred) } ub->st_uid = so->so_cred->cr_uid; ub->st_gid = so->so_cred->cr_gid; - error = so->so_proto->pr_sense(so, ub); + if (so->so_proto->pr_sense) + error = so->so_proto->pr_sense(so, ub); SOCK_UNLOCK(so); return (error); } diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index d2b8d9095f13..a3401091bda4 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* XXXGL: remove */ #include @@ -175,17 +174,6 @@ pr_ready_notsupp(struct socket *so, struct mbuf *m, int count) return (EOPNOTSUPP); } -/* - * This isn't really a ``null'' operation, but it's the default one and - * doesn't do anything destructive. - */ -static int -pr_sense_notsupp(struct socket *so, struct stat *sb) -{ - sb->st_blksize = so->so_snd.sb_hiwat; - return (0); -} - static int pr_shutdown_notsupp(struct socket *so) { @@ -246,7 +234,6 @@ pr_init(struct protosw *pr) NOTSUPP(pr_rcvd); NOTSUPP(pr_rcvoob); NOTSUPP(pr_send); - NOTSUPP(pr_sense); NOTSUPP(pr_shutdown); NOTSUPP(pr_sockaddr); NOTSUPP(pr_sosend);