Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp8254lqp; Thu, 4 Apr 2024 05:53:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvNbSx9Y5TwC5bd72QG6WgbUGqWo9UOdyYbiXA6sgrNDW4ObtULI99WWd74kOSauasgn7UY9+47PfC0Hw/3pDb9j9SfskgD1s3c7iYSQ== X-Google-Smtp-Source: AGHT+IH9oN3+iy666aRyCIA6Ej9HTHbk56htc95PtQ8n8piXf9/TwVI4+n6eiIwJtyfMutrT0qZ8 X-Received: by 2002:a17:902:f68b:b0:1e2:bed0:317a with SMTP id l11-20020a170902f68b00b001e2bed0317amr268086plg.21.1712235227726; Thu, 04 Apr 2024 05:53:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712235227; cv=pass; d=google.com; s=arc-20160816; b=ixfeHvip6ZX3KJam52n+aAox/yJLu6CUPF7KnTe4rZq9GTWocUA4LKC8ZIG3QinkH+ Ot0IZ0Qf0DAA2FD4mpqiqjR7fpyO3piq3dEFDNjtx/Kyzm5su6Yzue9N5dcrxlv8T2Wf 1FSqqXkH3KFoSlLuRjBCG5m4W4ln3s8Jf4/Gx+lJXudohskFVxBdxhoFrQDSsblpP3B6 x4k4tsUT9E7fYmubtQ5YW5iTAiLBagIMoegNztO/HA5NTFXQim5MSBv1owXET3s4ipNo ADsGlhA1MuwtUlQ5Ys/Va41PaE17Yas+ho5z8xLr4SxkdEdZv2atUuBNk8NjbkZewAkr +N3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Dilzk8OWnGF3Bf9NwUgRR1mfv9NXWl/ZDYX9xlEWStQ=; fh=sHXAFZwfPc8Fr4YqAFDjo/6NCEBUFOWKXUfG+u2P2PE=; b=ujEAk3OfAkZYpTbTsMMCz/peSvC26b43H0zyRln6pURA9LGJalaHlKtFySyfoTbwOA L1lGw/31tMj1iCyDO9DzXsJQ77owjue5RCTZfMr7jOTqoyqRKZhWgq/+e/pO0MvMHmgm OFneJnPGaCkFBtB6pEbafJ8rNeZerkIyVShw0SJ1SH2/ajlKqZ3ENfPlDUc5erTonrLQ ufo73NgmrwdxJYeo6jTs5DWR44YjDE0N4zETPVIj/HLQObrCRo/78p9xMMzX+DZ7CIYg j8h5XD9yZAo7SIS2FYzSEr3zF2BnVJQxuqR3iKyGdb7ynLZ3QEw8/WeOG6QU/eltc9bT xDpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=Lej1FBTA; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-131469-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131469-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id mb8-20020a170903098800b001e271fddd9dsi5329825plb.590.2024.04.04.05.53.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 05:53:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131469-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=Lej1FBTA; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-131469-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131469-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9234728448D for ; Thu, 4 Apr 2024 12:51:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D15984FCC; Thu, 4 Apr 2024 12:51:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="Lej1FBTA" Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2FAA374C2 for ; Thu, 4 Apr 2024 12:51:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712235087; cv=none; b=Upq4HzEHBMBqAlamc6vhsRA3vbljDMmr2d6aAUBK62+gBfpiaPmZ2SukKo0pXGH4wxlLr01kZDAGTM91SdiL0asc0fGg4KJYxsGi0X6WcRgShHnhfLJnRWFKEHerlv2sezJTqEKahOjKMeArtTTF2oG9HdphddwwLnHP9OzLLAo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712235087; c=relaxed/simple; bh=6mmk60SJwL0LXWdZ8yrVVh1oB9nLf+a+MA2UbF/G0Nk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XjYmnWjYCqGR4oHDvVmt85+W5PU2XyD3uWqxwbjqProdQDoyjQOS4dQwJnr15p1KssoCHcmU4drTVTIGjSgY6NUOsiwjH4u6suo/+HPia3mlUUtHq1yjliQOsDIESM6pNEYi1kQLLE2xKLwfsfUakeJKr72HS3MmIx9H1buzGog= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=Lej1FBTA; arc=none smtp.client-ip=209.85.161.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-5a4930d9c48so165001eaf.1 for ; Thu, 04 Apr 2024 05:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712235083; x=1712839883; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Dilzk8OWnGF3Bf9NwUgRR1mfv9NXWl/ZDYX9xlEWStQ=; b=Lej1FBTAjGDMR0Xhqjd9zGKNlOiWuk/KU30pnaIXCU0t5KniV+cirLwyjUSlmK9vm1 9qp43evszQ3m3o2nEUHi8UqGH3A5KRrvsIi7rRpOU+n8LsHUbN65lTyMJepng9Usap+j AsTKXoUk+UyX0i7cqttjXQSuQjRiTrfO60ezWYNE5be2KEvZFAv+7Jf05W1nuRHrcVho FzI7/bQkFqzUs1LuTEvZnb5tZO1SNHgS5k6nhAWxltZ+ZYjNKAxY52yjpoWwHmH02z63 8XHqrQLiUcomtePJauEftn8+1oC5tSMaldTz/lmy0JHNo77L14Fw2Lk9kSWpjyg1Gu/j /PXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712235083; x=1712839883; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Dilzk8OWnGF3Bf9NwUgRR1mfv9NXWl/ZDYX9xlEWStQ=; b=l9AGxjAXWuTY2zF+PmF2WMcwnVLAuDWF97ZRZPyxxRW0c5hUTMo8rxUm1SCM59hZQO DCoJivkfcYQSmWqVVkcpwbNeMZHNlsygrbN4lM1gY3tC0En0RJWQp9fql44lUExpBbHN 6wTCycqQJgBzF/oxdkK4+67imwNSOTjj0i/oTITePfK640DoUlywN7VS4e4jPA9aMSZa ab9ek7/G132iFJr/JTTLXdFkvIlIarMwMuhwtRF/mQKTGrjlY3HJa7AZ4idXGqP2kJ8L 1OZ5L8laECHt2djBkEmHvjKdN6kbDPJnlnjVXxwdPVfWVwPYmror6Jvtlhlfjip+BnHE IQyQ== X-Forwarded-Encrypted: i=1; AJvYcCXeEfYqAqnjlrSRx/tmyg6u6ZlFdjSkONf1oADP9ZRDBTXwCJUibhD4/6t/yQvgAabmAy4bgucKMhcg16+VjrlOYPNEFn7z/CmDajKl X-Gm-Message-State: AOJu0YwnFlFLr/Iamy9no7HcO+d2ZeBhu178Xpq7h7GPbNLdXeRCGjbl tBkK0yQ52jlOHDKldlRnTHFTwCge5hitaTawwcBLK9FT+sKRipUwv7jOJ3b6RDs= X-Received: by 2002:a05:6358:3414:b0:183:e7b6:60b1 with SMTP id h20-20020a056358341400b00183e7b660b1mr2236039rwd.1.1712235083603; Thu, 04 Apr 2024 05:51:23 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.194]) by smtp.gmail.com with ESMTPSA id b26-20020a6567da000000b005dc507e8d13sm11739074pgs.91.2024.04.04.05.51.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Apr 2024 05:51:22 -0700 (PDT) Message-ID: <6bb82916-7c79-4af9-9dd1-f668845aa418@kernel.dk> Date: Thu, 4 Apr 2024 06:51:21 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] timerfd: convert to ->read_iter() Content-Language: en-US To: Al Viro Cc: linux-fsdevel@vger.kernel.org, brauner@kernel.org, linux-kernel@vger.kernel.org References: <20240403140446.1623931-1-axboe@kernel.dk> <20240403140446.1623931-2-axboe@kernel.dk> <20240403224037.GM538574@ZenIV> From: Jens Axboe In-Reply-To: <20240403224037.GM538574@ZenIV> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/3/24 4:40 PM, Al Viro wrote: > 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. Gah yes, ironically I did a bunch of conversions yesterday and it's all fine. Not sure wha thappened here. I'll fix it up. >> + 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... I do, but figured it was cleaner that way. But I can change the flag passing, ditto for the other ones. -- Jens Axboe