Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16870404rwd; Mon, 26 Jun 2023 16:50:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7dJCVzP6lwNSqAw7ETiGerO1jHF+E8CAYigySo0T77k7s3GMZ3uavXf0ssjF8nN0cN7r+M X-Received: by 2002:a05:6402:404:b0:51b:fbf3:d9a7 with SMTP id q4-20020a056402040400b0051bfbf3d9a7mr6839683edv.39.1687823450163; Mon, 26 Jun 2023 16:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687823450; cv=none; d=google.com; s=arc-20160816; b=CtMLpawmEhCNE5Fv+M7VC36dVft4Id8bOOYVTb2PLBkjU0+yvAiMbUmn2g09vIO1b9 bazTsYSC8zZSp1pCppgMBE8s+ay+HyfLVkKHHyRc9ksPPlg3tKEb0xe67JIFDyQ6yHu2 umANps8NnvzGu6yBeb7viyQSTOSH/OXgnckkUlsvmgF5e5DhDRSTkqeRzidCxQpPtIQh woiS0AlwO8F45T+5Gu0g/JsyOhl6/kTyyVc/FbcjK6CXXgIao/yNbqWzugfG2NWIf7f+ w9MgbjGOAk6vRmrlarAabw1mu/yaCCsz49SpJhiLgu6VR7WnWXfJyWqu5y/uAafxXMSP L6pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=dVmGHp5YLhfRZplhoZ1BMOCeE/kkSWqsgvaoxUBUoaA=; fh=IHFQlbVsC+DUr5Z3Sb1CE3j8cu6SvNBPXxR31tL4TGQ=; b=yHaAupFjY8iiiwRqbFr3/MvICen1BTass8ukzcpk4GPp/hTfzTiWawv7zcE5rv1wMB Uz1x6bTD/BCqnlsQ3BEzXTuc7E7RI3a2N22RbaDKA5Qs+S3DTgpUQfcndsK9T6iWoXlE 9GIt88c04qshnZ74yOLPiphnhyy39fXOYPa2vaK5jdWa14u7LiDnfyVxr8VNtfyinHnB 7pOzKZ4L0s8v68MPFNB+gTVPIclojE//sddSLZYvfaDx9AXowFgPvZrsX0qMOFDO9tW8 69kMzDehfagT/sDmivI6xkJnBnwdCnMKqLwol1eUzbkz3/ArktIY36KkdLdJ/5Mr7RGe VIGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202305 header.b=bk6TKlHs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w8-20020a056402128800b0051c57bea395si3052595edv.653.2023.06.26.16.50.25; Mon, 26 Jun 2023 16:50:50 -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=@nabijaczleweli.xyz header.s=202305 header.b=bk6TKlHs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229886AbjFZXIp (ORCPT + 99 others); Mon, 26 Jun 2023 19:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjFZXIo (ORCPT ); Mon, 26 Jun 2023 19:08:44 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF82610FB; Mon, 26 Jun 2023 16:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202305; t=1687820919; bh=iASaIQSREKLq2OFVu4k4J+TAbxohSrL+yjCExkMJmeY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bk6TKlHsfUUcFxuVbDcSAjmmsUMXwKgcojyjXMlinXZS4Q45RXGFagnjSa2Y5MRXb U/chkw+pv6FTegKkZVDpN389XaGF6+VudrsW6Z3tsbr/BQD9LRGdkxdMrrS7Em+TbS HmZ1L2pYudBMIKl6lpDQxDgG/Em/HbwUh8HneMsja0jzSo6I5ov+E5ZTM9PEmjKIAo 8TrD4E/bYehXw0LS3wzH5y82JDbZHkI2BlqWwZ+YZYBW4wOjzwDfaL4MhaozxyW/p/ n+xywt0inXLQb3nA9S+/2d5xtHxK8fiVuwOAcaq8DjPL9XnBR14SB+aCi11VSni8Bp Uu6ogLMbwAweA== Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id A6EC9CFC; Tue, 27 Jun 2023 01:08:39 +0200 (CEST) Date: Tue, 27 Jun 2023 01:08:38 +0200 From: =?utf-8?B?0L3QsNCx?= To: Amir Goldstein Cc: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , Chung-Chiang Cheng Subject: [PATCH v2 0/3] fanotify accounting for fs/splice.c Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="u5ahfxgiox6lrsd2" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20230517 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,PDS_RDNS_DYNAMIC_FP, RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 --u5ahfxgiox6lrsd2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable "people just forget to add inotify hooks to their I/O routines as a rule"? Guess what I did, fully knowing that some are missing in this file :) =3D=3D> te.c <=3D=3D #define _GNU_SOURCE #include #include int main() { ssize_t rd, acc =3D 0; while ((rd =3D tee(0, 1, 128 * 1024 * 1024, 0)) > 0) acc +=3D rd; fprintf(stderr, "te=3D%zd: %m\n", acc); } =3D=3D> vm.c <=3D=3D #define _GNU_SOURCE #include #include #include static char sb[1024 * 1024]; int main() { memcpy(sb, "=C5=BCupan", sizeof("=C5=BCupan")); ssize_t rd =3D vmsplice(1, &(struct iovec){.iov_base =3D sb, .iov_len =3D sizeof(sb)= }, 1, SPLICE_F_GIFT); fprintf(stderr, "vm=3D%zd: %m\n", rd); } echo zupa | ./te > fifo tees a few times and then blocks when the pipe fills, at which point we get into the broken state. Similarly, ./vm > fifo (with the default 64k F_GETPIPE_SZ) enters that same state instantly. With 2/3 and 3/3, they instead do 1: mask=3D2, cook=3D0, len=3D0, name=3D rd=3D80 1: mask=3D2, cook=3D0, len=3D0, name=3D rd=3D80 ... in a loop, as-expected, and=20 # ./vm > fifo vm=3D65200: Success 1: mask=3D2, cook=3D0, len=3D0, name=3D rd=3D65200 I took the liberty of marking 2/3 and 3/3 as Fixes: of the original fanotify-in-splice commit as well, I think they fit the bill. Ahelenia Ziemia=C5=84ska (3): splice: always fsnotify_access(in), fsnotify_modify(out) on success splice: fsnotify_modify(fd) in vmsplice splice: fsnotify_access(in), fsnotify_modify(out) on success in tee fs/splice.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) --=20 2.39.2 --u5ahfxgiox6lrsd2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmSaGnYACgkQvP0LAY0m WPE5LA//cvaUBrA93SjLEn8aSKrha/Xdzj+yQwa1lvefbPW7DIJ4rCc8RepslTie ShLW0t+MAfOIpMLRNxLWv3SlhyWtCTN/XqsfwmL/4jtpGfM3vcyPOiXbQPp7304H 1qOzYCV/FUEgEUu1ZtYD2PRNtLJfIwg473Yx/+ib/0trWAWDid3BfkfmSEbK13ix ZCxd+/gcEX/a7GTrIAiSW4ki8Mi/yX7FyMK5VvHoDIWop3z1EEYwapKxYzSvqjCu g+KVXFXtBOvVPhcpsbqPoo4xyT7Ew+LzMKdnogaySOOMiEpogjQ2aL7JxGPiZj/M 0JcGqjVJUvWhZw5g1egwMdq1mZP4SIjL66Q2BC3SD1K89v8JsJtfGZr5l9u8IS/r k1rmKZ1ClnHPNyIQtFl34n2F5KkRdyJHvF6u4ZzQy0px2tr6EkUTNH5qBbSFSiNy S4p3BbR3vnxyKFYud6gDPBXkOMm3euIJcdjAnT6nmjFXab5OuMBTAKWsoMxeKg7x 06JoMBaTFhp/LHCV1KMNjdJGIXWnVnmONX0FDIkKSncayKGBAZapzhCc56ADaDK2 0XR2Jua+uux8ueuYqWg7CwChS1oSHtSE1SCZMAZkqvHjkBou6ogLN/AKTDzIvH85 OEPRfej4bd439khKCAQNVZio0cSV7KdLxzWBVne2fPZ8HmGxKU4= =TrVD -----END PGP SIGNATURE----- --u5ahfxgiox6lrsd2--