From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.149 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795963370; b=G2+twqZNF47murMdac6egNBc2NqrrfTdSeNEmcwMcT2xJNcvw2fkVjvvq83JTwO2gDN1 tN2Vg1Jtz47IGW1fu+wO91lb1/JIlb2EbiFpvixnNYuZrAHdugaxFI31vNKosafFEM+Iy f5Eb7AGEJQEk4A6gY8x2kiKLmH+5JndT4Hd2TAaZA0BZjpdNWVHwfplIUiFoS7+6nTj+g 8wWnrhoOQd1fPFCBcKtljuzdIRbAmgw7zX6wxDP4c59sGAf1ybpzKfJVj1CuuYS7duLLt SRMaUuU2cr/yInAErLA3bQu7r1lTtaaLe4LbaGY2D87Rxf1NBPhgJ6ED+y5iGMVCROg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795963370; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding; bh=QS25yluRG6cnksuS8AXVHqcwPBWMT+xJYaFxJPPlmrY=; b=yUQ97UXfrIKJHmaWn6iesXFBag7/lBv97g3BWuQIZ/mh4SvCNrGkK/Rq/mp86q4W+8K3 1zYmMKNsBpPoS84H2HVpXrE1Zko0wRqX9htWWWckSk7NNe/4tJ/w3dmhIavRORvfp/xRT He2I1R2VVTgU4sMXgbK0PX3yAfmQLUeX1EIc2F7a5qoDPTKV8HeNMfZKNg2wUW+6JVB+2 h6Eor7ocjPtndTOVbIi6T9snP0LQS1AgeMHriHwnvFLdyokfitK2+/MmGssdaoFCxMFuh SzVlbTbE58F7hARTg3k/b7IVHwrNQHDzxaNHByBeJkgzDizQnA6eOh+4GmFwtqrKwQA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=fastmail.org; spf=pass smtp.mailfrom=fastmail.org; dkim=temperror header.d=fastmail.org header.i=@fastmail.org header.a=rsa-sha256 header.s=fm3 header.b="u/k7gGam"; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=vZfcKPRE; arc=none smtp.remote-ip=103.168.172.149 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70B1D606A323 for ; Sun, 29 Nov 2026 14:42:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 70B1D606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.org Authentication-Results: smtp.subspace.kernel.org; dkim=temperror header.d=fastmail.org header.i=@fastmail.org header.a=rsa-sha256 header.s=fm3 header.b=u/k7gGam; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=vZfcKPRE Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 8AFBAEC0948 for ; Sun, 29 Nov 2026 09:42:49 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Sun, 29 Nov 2026 09:42:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1795963369; x= 1796049769; bh=QS25yluRG6cnksuS8AXVHqcwPBWMT+xJYaFxJPPlmrY=; b=u /k7gGam1T+yIs7wpyg00E8HMNNG202PD/beBuammXfgbqMLH/1u9fJawtQs1Xakq J0WsN/FrQ8P64AimO9xCWK492dgDCifuxmnzhwSPSaL4TcDfPR+YXADZojXbJiEq OUEA1WZ/TXbB+6SBh9YGPhZs9AIh1C1COY7AikLo4BYXcKmmTbgYASxPfjY39ESY QfJaAMP+QUYm2Ft2yYZMnzNWWchmFXH629gW86xS9GtR0Nl5Idkg+z9L6V+Hof2t StP+078xLsLFpctdbRGGoi67BYUrrQ5KSwH7KF8mfRrC3RD9995Ee0Nbt+hO1fAp cU+2UiJUpIoSTZvR39Wqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1795963369; x=1796049769; bh=Q S25yluRG6cnksuS8AXVHqcwPBWMT+xJYaFxJPPlmrY=; b=vZfcKPRExSxuwRTuq F2q1YjpXQQ0gpM6VdqREDd4ZHnqJIlvUslMOHYFCO9RajKhS6vx0jbSgT/lqi6C0 ciTJdeWwB4JPxNF1UzP6l28kmO/Zt1xDpUkW7+tSie4c0VjgYksNbKb00JJtZiWZ vrN1Oa4KzQzdPbN/veLsqwL/u4N5XQkKgIkk+Rn2axvpCoBZTsqAhFKq9ftALCeU cNCdIGsuvtNuV0ghWBpT0pRvncbwbEJQfivtkGdv/WxGNdkgThflrqlnKG2tvV7z o//jZwc7FgDwBifBXiegET9bnup8TwaPf9qdZmqQGxbTPjX75CLEXsDefZfd4HzG o45ew== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=fastmail.org a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1795963369; d=fastmail.org; mf=PGljYkBmYXN0bWFpbC5vcmc+; rt=PGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:xodkCES+RrUgsQctuw+gp1Szjx8I6yJcUMM/xWUEvHaEOZn ZSzR3VSASOD3kI1nIYoX6gm47yuK0Dk0dF6JmiDym3YrKO5Mu800ocXWCRdnzO8F rP1Ao5tabq5o3Hx4WT9lV+fZi/Mn1MegIVF2v1YcRwXkKkxov659ekPnz8QpJzNg k/1lpTQsHzGqKyJeurWuLUilsGSWWuCAP7vIxuwkWrMmY0k5aqsZarXYiIdKcOtQ VwwcfKwXpqLu+BrVZtdZZTQrINK3eNd/0fjJszd0k0EcUTTnEMF2N3lMp/sCvVuK xgTGbXsP+UDfsLPw4LYa/t8HN0mwBCd59vdn84w==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=11; hn=cc,content-transfer-encoding,date,feedback-id,from, in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:ZcJiT0g/w8MXHxxx2aJTWkhbiVr/OfOq46GYXoXAHEc=:QS25yluRG6cnksuS8AXVHqcwPBWMT+xJYaFxJPPlmrY=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGwtaK1HsqZiAWpI+cho4ODHb/dzCY9zpj0xz3cCaDukV1eh/trKP48fm+QU7bn2U G0yCEbu4vdH3WXLMOrWeCqk31rJgpC33wasQkDla7knaoMLkvxqVmZsDuJ4Hljb8VurF8x C9prxdb6NfH4QX465zkBC4g8rGjAQ4WaO1tKyToTyNiOcszClZQdkTBisWxvFvS+2XvVEr 9nlpHesdE92PPcev/OlNKCdN+4yLsaofAYKnOc8DkL8cMiyUQFA/p361GQQm0+SkG48G8X ZbITI6iJO+tYPDVvH5wdzh7J8ZvUa2FJ8OkCjdrP6F7IF9Xy4vWfxd4SizoG+9sV7CLZQw dbfJ7krzf2ZuJoHgOS/qeGr5bkfgWf4i4emlDNW5Jjq656MeudXa6tZedas7VNMYtsLWO7 12utgQtsPldeW7iJPsrqRXu5j4PFTvAfJ6EXHC+ueciQFlemT1Vn19Eor9ngNdqTQcP81V SYyyFDkKcRWYyHKXV3zJ9xGbwN6IdCnehbOLn1MNAuyDgR/IVUBzz0W/BQsAgpm3DwMKTj BwPyIaMzX+tKbQh4duZU1TP/X/U+JNDAA4o7JC8E54r07fNaDZ0CSdB6/+AdnxV7G3iufz 0fA8oLZCACUCCkLJAu01jZ+As2wU2dSN4d7jM22fBlcDddp/b2xSmrbsXhQw X-ME-Proxy: Feedback-ID: ib53e4b78:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Nov 2026 09:42:48 -0500 (EST) From: Ian Bridges To: linkinjeon@kernel.org Cc: senozhatsky@chromium.org, tom@talpey.com, chenxiaosong@chenxiaosong.com, linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, Ian Bridges Subject: Re: [PATCH v2] ksmbd: return the cause of a failed link Date: Sun, 29 Nov 2026 08:42:41 -0600 Message-ID: <20261129144241.1922573-1-icb@fastmail.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: <20261128151818.1784793-1-icb@fastmail.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Namjae, Thanks for the review. Please drop this patch. I'm moving the work to my backlog, for two reasons. The patch does not fix a bug. A link that should fail already fails, and only the status is less exact than it could be. And your comments showed me that a correct change is a bigger job than I expected. The core problem is that one errno often has more than one meaning by the time it reaches the handler. Your -EXDEV comment is one case. The lookup returns it for a name that leaves the share, and the link code returns it for a different mount. The FUSE case is another. vfs_link() returns -EPERM for an immutable file and also for a filesystem that refuses hard links, and the i_op check only finds some of the second kind. A shared map in the handler cannot tell these apart. Each one needs a special case next to the map, and v2 was already collecting them. I tried a version that solves this at the source. Each helper in vfs.c returns errnos that have one meaning each. Where the VFS itself gives one errno for two causes, the helper looks at the state after the failure to find the cause, without reading i_op. Results that are ksmbd's own decisions set the status where they are decided. Each handler then ends with the shared map and no special cases. That gave the right statuses for link in my tests. But it does not work as a small change. The lookup helpers are shared, so cleaning up their errnos changes the statuses of smb2_open() and other handlers at the same time. Some of those handlers also depend on the old values. To be correct, every handler has to be converted and tested together. That is a series of its own, and it should not ride on a patch that fixes no bug. I'll come back to it once the fixes I have queued are out. Thanks, Ian