Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp25099lqe; Wed, 3 Apr 2024 20:27:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVPl34uXPPekv5TObm77FBZ2nBLVFQlIniKPEI8S3IZOpD9JyQNLjBvhDHXPF1U/fhJQxoBrvAZmZ/YG3WwBZQh3L6hGze+LQiDmofp/w== X-Google-Smtp-Source: AGHT+IHH2CJS2j2VV59za0wLdvMaJBzILlB0515MIN7vMTRwgEznuiMURwcODpvJv8YMWNF/2Uy0 X-Received: by 2002:a17:906:7954:b0:a4e:a068:7f with SMTP id l20-20020a170906795400b00a4ea068007fmr774309ejo.49.1712201240028; Wed, 03 Apr 2024 20:27:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712201240; cv=pass; d=google.com; s=arc-20160816; b=u1KiUSMaEtLdcknQZs2HPLqXfbk83zcaKbe98GPGGX2Rb4yqBkwyZLSY5DxI0xHofL Kvxp86tShHZZ4vtK6+5DIqQKVlW99viNEsc3dLbM3OU+wm71O2QKl7fbWRG3ghad0ghi UZtdTytQ5b3NWYK9NS2keu+PmyyM6QACdT3KuB3wNQfMcwd77yU2IFm4e8b4TwreW7X7 OSkLkPzQ0Hq04ArhKBt2To90rDPOte3wj8ijGGWAzrMzGIcG63mIbFAHKf0ofRGJNVcs fC3jaxKg//YifnHpf1OEhwcQ63x571QieC6rs45MR+yGSHeOU/AQsZczYVDMBGwXtQa/ Phyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=1npgfG17mHVKv3jerNoPzNQLvjBifSU4oBnZgQvzF3Q=; fh=oA3V8ARPOSpr84T+i6QYtNgpLHOc/8pugSGyO/YUNHo=; b=Cksiwfhj15/Spb017dAxl9fr+KzzCdPGeF+K4bYgkqEj0QKb9O7T+58hnRnPsh3mP6 vcrjQ6Gt+U3KJvMml4dOP+79cvMJJ5LP548zejy+sNl50rLvgXr7N1NsawC0RUPBmD/X lJPCXY46Fsi3gl8dF7WsxCMWO+ieii0Ufff8o37qs2qnX18IJRodOnmOtAuHFXAZzLCy WY/aXlD0m+l93FrjrPdZ0bmOJVyJTWSGHH+cFifUsW1trN1J0WnmXCm9jFPN172MYYf1 0ZKpj2DHWT0jnJTEDmpGp5sqI5FxtGwB4U4kypjG0ftHGrlYgLWoi0KnRhsSz8WQ2hYn CicA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="mrR/KpgK"; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-130692-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130692-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t15-20020a17090616cf00b00a4e963164cbsi1717764ejd.747.2024.04.03.20.27.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 20:27:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130692-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="mrR/KpgK"; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-130692-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130692-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3FFA01F238CD for ; Wed, 3 Apr 2024 22:40:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 231EF15623A; Wed, 3 Apr 2024 22:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="mrR/KpgK" Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B50E9692FC; Wed, 3 Apr 2024 22:40:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712184041; cv=none; b=FAF8QBjUYw3mEcCoxRFmjA8iiwYK3jrSnBddSYcYWHrv5wIikMlZAY/jFCnUMPqI60rMinnHMjC614np9mq1xoXwPUoKRVViJhKVsmvyYmnK1o83I7k7N4SoGYoh3GeXCgjixUOT8b3acROPdO0Fn7OFV8XIUPY6MLPwxOFhjPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712184041; c=relaxed/simple; bh=2cgH9YR8FnnrQGdsLTiqmanJEs/UuvAQD87+LbLt1Mk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A7EF/Qe2z3nePHpNbxGsPKIEyeMxSAw50eC8twOFQkqIQNaCA/T5rZelTuQwp7xyydsFOKwjYmaTPa8JQp+Nkf75LfhYTXmGnxeEUpw1KS2HVoibFRBr1XjpuZ1AKlRv1olDR6d6esWsHWYgwG9f7hKjYsGHQLMasSMwuhPBeDA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=mrR/KpgK; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1npgfG17mHVKv3jerNoPzNQLvjBifSU4oBnZgQvzF3Q=; b=mrR/KpgKNoNTqz4sqN0Nn+9ZsY Ap/TJSW8PKvmgjMcnPB8dZ/UDddI7IXQZ6ytCqgm9pUIu+KT4ZgB2Mxqfe5EOdJTIOYtOGp4AIIsa MedGQAyeUII7WddxItOpkYzTFbPYipbxil6t6CDAc47N0AjPHJwWb3XPK0BTzwveZQ/Z3VpVh2udv J/vWCyQ6x+E6d7TdX9ImvXenVI/Mjpk4oTLZVKLB1+xauzoHCazMDKUVRZfUeHiE0+PHXTAyyXn1c 943/ipdEMeQibPe1Kt92cTWaphC3/WSveZjHrVkGYpVxbX+I3RELlSb7XZAxk/Vc+cqz8umygicaJ dLHmgugQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rs9HZ-005BUP-1z; Wed, 03 Apr 2024 22:40:37 +0000 Date: Wed, 3 Apr 2024 23:40:37 +0100 From: Al Viro To: Jens Axboe Cc: linux-fsdevel@vger.kernel.org, brauner@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] timerfd: convert to ->read_iter() Message-ID: <20240403224037.GM538574@ZenIV> References: <20240403140446.1623931-1-axboe@kernel.dk> <20240403140446.1623931-2-axboe@kernel.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240403140446.1623931-2-axboe@kernel.dk> Sender: Al Viro On Wed, Apr 03, 2024 at 08:02:52AM -0600, Jens Axboe wrote: > - res = put_user(ticks, (u64 __user *) buf) ? -EFAULT: sizeof(ticks); > + res = copy_to_iter(&ticks, sizeof(ticks), to); Umm... That's not an equivalent transformation - different behaviour on short copy; try to call it via read(fd, unmapped_buffer, 8) and see what happens. copy_to_iter() returns the amount copied; no data copied => return 0, not -EFAULT. > + ufd = get_unused_fd_flags(O_RDWR | (flags & TFD_SHARED_FCNTL_FLAGS)); You do realize that get_unused_fd_flags() ignores O_RDWR (or O_NDELAY), right? Mixing those with O_CLOEXEC makes sense for anon_inode_getfd(), but here you have separate calls of get_unused_fd_flags() and anon_inode_getfile(), so...