From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2D13EB64DA for ; Wed, 28 Jun 2023 07:56:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230341AbjF1H4r (ORCPT ); Wed, 28 Jun 2023 03:56:47 -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 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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.