Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp398212pxb; Wed, 18 Nov 2020 07:20:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVZpWjckCy2bI8qNS1e4fh0MYMRaEvqENtkdDi1RCMGltbqra/pOMauYaMQes0HA5ZDOF8 X-Received: by 2002:a17:906:660b:: with SMTP id b11mr25986722ejp.190.1605712816106; Wed, 18 Nov 2020 07:20:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605712816; cv=none; d=google.com; s=arc-20160816; b=hHKd+w902hHxsrS1HZD/I+L1InivayZ/CaEBhXD4t6pY9UnJtlMrOssUVl+xdgO9YP idkHNN3CEXO9Dch++SqTI3K/6141xYpOkxgpM0e0MCSI8Rt91dogsJB0cHOZ9d+LfQyo AlPlTH8GbZ1ttgyDGyY63TAMBtCfVZulkfwykCckJygDqEZpfjdB0Tf1EB64u+Ux+8nH GbFEZqj90Oxoe+FM7J3pDtNDUn7p+xXmwZGQC/JH59A0yrKeD3621x3WCD3AKF/Yj4w/ uyjtt4hR+0ItXU3DhmQ1Fx6tRa3/3qKGHP7ryIK67NFdJQ3XRlJjVnrT1F04udtFqAVi CWnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E5AWr005ZKFbj0xARuPSwpcPr63RRv1/s0GYEoynaDs=; b=iivHqzL51JIC8rLOy8LaaYuCVpqeNq4dosImLSVR1UquLhXEj9A+VnlQ9EZVn/8xan Vh7faVrrnnI79/P+1xNr2PX+p0ejPJC6dKpluc/yyem0TTh7Ny7uD8zqc+6TvvGAs/Ee v4sRCjeyseOV3Hb0Nk81xir366m4+SfPqp0tVrQVy+C78//Q8mLeLl6bF+ZWRHHezXbH rDRvrlBS8ox+hq3Q+PJPys84FkDnVwoRmbNvdpF+vAQtW6cdZKL8r8cwPjQbPaNxWva/ VgPpwb3kAsHTTOSCM3HpTubjPAuwVe8/s6KZDwZ5tDWqzXzeJkPceJCIsbeC1/pRfdCE xBZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UQTdS4lz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ks9si15600268ejb.1.2020.11.18.07.19.53; Wed, 18 Nov 2020 07:20:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UQTdS4lz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727150AbgKRPSL (ORCPT + 99 others); Wed, 18 Nov 2020 10:18:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726374AbgKRPSL (ORCPT ); Wed, 18 Nov 2020 10:18:11 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE094C0613D4; Wed, 18 Nov 2020 07:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=E5AWr005ZKFbj0xARuPSwpcPr63RRv1/s0GYEoynaDs=; b=UQTdS4lz7RdwKWWIgtMBMQ1+94 EYYX9vjZJ73KleKO1k3dSus0T2TpUbs23iRbpKidfOCx8+M59jJ+tf4yJuMUOy3dQUg10JWBqopEH P32VgTOKCTxTwbETMy53ukX/cJ4J59SDLRwI+oRrHhTtpXUr37FyigVMIolrGaUzGUMawxJLHLO2d RWa1OouI62+Kllslsb+CubbOARYbRtPHDB6GRtARxGWFHlAG6lixtJHa3FND8TJHORFipJZuyZwxr 5W5rdcvby3IS1P6ItpkIL5haQB4tYIY5JpDfcXwq7r7hRYHXmDvF2E0V/5BU2cLyBwLsFCtQIKqc2 tMtnsiUA==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfPDi-0006mk-KJ; Wed, 18 Nov 2020 15:18:06 +0000 Date: Wed, 18 Nov 2020 15:18:06 +0000 From: Christoph Hellwig To: Michal Kubecek Cc: Alexander Viro , linux-fsdevel@vger.kernel.org, Jens Axboe , linux-kernel@vger.kernel.org Subject: Re: [PATCH] eventfd: convert to ->write_iter() Message-ID: <20201118151806.GA25804@infradead.org> References: <8a4f07e6ec47b681a32c6df5d463857e67bfc965.1605690824.git.mkubecek@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8a4f07e6ec47b681a32c6df5d463857e67bfc965.1605690824.git.mkubecek@suse.cz> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 18, 2020 at 10:19:17AM +0100, Michal Kubecek wrote: > While eventfd ->read() callback was replaced by ->read_iter() recently, > it still provides ->write() for writes. Since commit 4d03e3cc5982 ("fs: > don't allow kernel reads and writes without iter ops"), this prevents > kernel_write() to be used for eventfd and with set_fs() removal, > ->write() cannot be easily called directly with a kernel buffer. > > According to eventfd(2), eventfd descriptors are supposed to be (also) > used by kernel to notify userspace applications of events which now > requires ->write_iter() op to be available (and ->write() not to be). > Therefore convert eventfd_write() to ->write_iter() semantics. This > patch also cleans up the code in a similar way as commit 12aceb89b0bc > ("eventfd: convert to f_op->read_iter()") did in read_iter(). A far as I can tell we don't have an in-tree user that writes to an eventfd. We can merge something like this once there is a user.