Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19007100rwd; Wed, 28 Jun 2023 03:54:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7FGZGX2o2tObsUzJf7hStAIfgjh/wAtvegx8WVHSCcq/7sRHR3aHBiNC+RIYXOq2nWZX1C X-Received: by 2002:a05:6a20:7d81:b0:12a:cc8:75dc with SMTP id v1-20020a056a207d8100b0012a0cc875dcmr5719358pzj.31.1687949694161; Wed, 28 Jun 2023 03:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687949694; cv=none; d=google.com; s=arc-20160816; b=sUJI3Wvb1EFm1o8JDDI9tayrkdnN061fSTWqp75aFzQE1mn+gigToXLTToaCVRjXWR jYjfYC6l+aQxHYKsPYFb+yGYVl61kTUz/5by8ZkKQpjm+eeUoQvNddlLry7FholfccoV zYQqhaQrVX6Vmcb20kji8NKuaeEWWGYdmDB2aeizsnADTRLM67bj+BtPFx4rJaOEulD6 P5KFKaTqCzF99ez5T/PmZX0voXLiDeeDpObBC2e91KVS7DygutrnnnTlun4OM2OOMqka yA+KMUDaFVf8Xohx0LPcup8Aye9Tl8ioqSnVVwcZ3vPEHKZp0Eq14QmgmIqFeY4qjG3z DR7w== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=bjzHtPro9Ner4jNsUFvbzQkAe6zc+I/EVaSBi1coQGk=; fh=Oiq3vNtR5lyJSDjcFHh1gySbJRrZwJ3pVD30iufZFDA=; b=eZDhcPrYGVOaYIaiP7EzmbQuniom6RhXe72Frm40Q1JikK9CD5IlkH9Mi4OhWBfBUL uGcP3vYD11QWmKcpGmonzgNBf+m7il+z/RkygDFF/QN49GQl5012V0RHx/O2EnmxT6QR 5CI7MvLzsJpUbZUGO1oBHRr+BIQc+zEie7+Bn5gAukK7W+57SzYi8Fo45z9M1rsLsDgP 7GbrW165trAfhBvwGS5AzFodGxfzUU2gzEppECWCgd6c2+fdjbHqytHg8DcPMp4hcprd y1BM+E/vGTsa5kQ8lbPhed1BYY/d4njWBs+9+jFZYp0aIUfXeW4H/Zy6YIjOhw8Bb4qz V8hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=lDd2o0gI; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a17090341c100b001b3bd85f54bsi9506182ple.35.2023.06.28.03.54.41; Wed, 28 Jun 2023 03:54:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=lDd2o0gI; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbjF1Kki (ORCPT + 99 others); Wed, 28 Jun 2023 06:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbjF1KiY (ORCPT ); Wed, 28 Jun 2023 06:38:24 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F359819B6; Wed, 28 Jun 2023 03:38:22 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B04C61F8CD; Wed, 28 Jun 2023 10:38:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1687948701; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bjzHtPro9Ner4jNsUFvbzQkAe6zc+I/EVaSBi1coQGk=; b=lDd2o0gI3rUCEnCrSAtsdlSRBwcA6RkoN7NIuSqs3FUIUTdwu/GY/2tF8OqZu176VKoYqq m6qW33R3Yu5gv7lX9SkaEsxw2l68AXvxZ3aJE+Yy+I/avacs8I3yMwkC4CDiQtGHNV6j8d pci/GT6ET5tT6KMYlL4WhMRgT4zoSEg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1687948701; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bjzHtPro9Ner4jNsUFvbzQkAe6zc+I/EVaSBi1coQGk=; b=J+kOUIr6cuQb0fhEWDEsuGaDa6vQQiSF8i6pRHXDKrINHw2LdopIByw7+qSC/ZRjMKuX1G SxZrQdvwyy31CTBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A1F16138E8; Wed, 28 Jun 2023 10:38:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id FEF6J50NnGRXIAAAMHmgww (envelope-from ); Wed, 28 Jun 2023 10:38:21 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 23586A0707; Wed, 28 Jun 2023 12:38:21 +0200 (CEST) Date: Wed, 28 Jun 2023 12:38:21 +0200 From: Jan Kara To: Christoph Hellwig Cc: Ahelenia =?utf-8?Q?Ziemia=C5=84ska?= , Amir Goldstein , Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , Chung-Chiang Cheng , ltp@vger.kernel.org Subject: Re: [PATCH v3 0/3+1] fanotify accounting for fs/splice.c Message-ID: <20230628103821.dnrbnext26ojviyz@quack3> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 27-06-23 21:51:05, Christoph Hellwig wrote: > Can you please resend this outside this thread? I really cant't see > what's new or old here if you have a reply-to in the old thread. > > On Tue, Jun 27, 2023 at 06:55:22PM +0200, Ahelenia ZiemiaƄska wrote: > > In 1/3 I've applied if/else if/else tree like you said, > > and expounded a bit in the message. > > > > This is less pretty now, however, since it turns out that > > iter_file_splice_write() already marks the out fd as written because it > > writes to it via vfs_iter_write(), and that sent a double notification. > > It seems like vfs_iter_write is the wrong level to implement > ->splice_write given that the the ->splice_write caller has already > checked f_mode, done the equivalent of rw_verify_area and > should do the fsnotify_modify. I'd suggest to just open code the > relevant parts of vfs_iocb_iter_write in iter_file_splice_write. Yeah, looking into the code I agree (with a small remark that unlike vfs_iocb_iter_write() this particular variant also needs to work with files providing only ->write and not ->write_iter). But we can live with duplicate events for now and this seems like a rather separate cleanup to do. Honza -- Jan Kara SUSE Labs, CR