Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18873178rwd; Wed, 28 Jun 2023 01:42:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6rieK8e1Hm1zt/un8xA050U5bjHL+aneqMaEpYwmCZvNMVvLZOuIytBdyQdxF6YIbWoRJd X-Received: by 2002:a17:907:9309:b0:966:17b2:5b0b with SMTP id bu9-20020a170907930900b0096617b25b0bmr28491074ejc.49.1687941755113; Wed, 28 Jun 2023 01:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687941755; cv=none; d=google.com; s=arc-20160816; b=iLCp26nK00uuqad04iFsM16EeAVO9XcFm/AqcWsbRTDYwHmP04nj5sTdxfOJ5UeTlo 692iuOomUhfWCP2CC+SkEF0ncGNyWxZ//62r8MysmfmmTd16achQeLabI4tKufePqzZA B5CKN0AmF1gR69BSFEo3e7nehRM8G/Xl0ZDVIPFghhjQy2yjaCTvONZS+88LWMqPuaCU zsvMEdKw7HCbSIb/q7Lo3ZGX8HBDhUzZg4RisIbj/8TnRfwQUCdllbuZj3A85J8rzk3w ODq0h9sikiINjjh+OXaO0DXOzFoYSaFY7/3fn7jzC1k97dgaF+4ZSJkjS2LGkgHwAuP8 AXIA== 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; bh=RQamssdUQ9C2xGj3PvgqarBFIoJwegp4eTAMgCLct08=; fh=obfL5Gys93vKdgc9KL03sG0WZ8edWPXo5g8IEem9+sU=; b=VcDYohlr0kZGXj8gZ5/ttZ9BvAH4qOtIReBDFh6nuifMVVqH2HfMpikSr9Gf5rlFaO EIIdD2VJQSILdGSHm6wACROlvkWrothHddXKms9JoFkSon4o8V0fAQEOZZsSC9hcwujP ofZkiitkW01MY4b81vT/SMqNde/3wDV/THjPAi495CLR2vjQvbFmXYOzSk98QYSmrQfy o7IMBuiHZN+WOArq4GXF9nfRISmKsDSxI7arBcVd+VepJfAUNW8rFmtOWx8ujwry0qlS 3KUIU8tc3TKMFz2ThktkZ/8o+kVvMJgNtjzlM43tjHva28fui16H1f5MeenhPaHGImr+ KRvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=sm051owQ; 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 z11-20020a170906240b00b00988e3b28684si5225722eja.552.2023.06.28.01.42.10; Wed, 28 Jun 2023 01:42:35 -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=@infradead.org header.s=bombadil.20210309 header.b=sm051owQ; 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 S230516AbjF1H44 (ORCPT + 99 others); Wed, 28 Jun 2023 03:56:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231146AbjF1Hyo (ORCPT ); Wed, 28 Jun 2023 03:54:44 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71F3819B1; Wed, 28 Jun 2023 00:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=RQamssdUQ9C2xGj3PvgqarBFIoJwegp4eTAMgCLct08=; b=sm051owQ1fp4U3wCrUuUPGG9l5 wo+Jrhvcjn9ctLPQBfidZmKJXvyM246rNQePKQ9sWKMOPgij5Q+yHvwY04b1ROPQZ8cbm18nvIA5m esEhiGz0J9GOCrpD6KPZWvLOvIXvzGEHu3FXJkbj4b8TchH/L7HPZKZ15s4ahDIiLbJ2tSn+KOZWe FNulJrFgADqpM04VhrNi1VuvqRSqtMbc4ud7+0vCFrMplq1497qcVvPpCApkVz8MAvZdeEHKs1312 oMPOV0ypGYkVtX5vBYHdey4cSpuIXoltL+GczqYbpRsJGrim/9YYTZWbZvqX1KX2S9RI4cdDtZPRZ 9Tf/gaxQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qEN8z-00Eory-0s; Wed, 28 Jun 2023 04:51:05 +0000 Date: Tue, 27 Jun 2023 21:51:05 -0700 From: Christoph Hellwig To: Ahelenia =?utf-8?Q?Ziemia=C5=84ska?= Cc: 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: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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 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.