Message ID | raezzuhjjoddoc5tsln2bg3rkudczwou4jjfq6noeawrtn6jre@uvf4rikifzpx |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7822201vqr; Mon, 26 Jun 2023 16:31:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+NFE1DfPpRxx9UG1hy96dmKadyC+CIF0yVzNBUPrJZxbpQKx302vbfPxfMQwITJ4RmlMM X-Received: by 2002:a17:907:3687:b0:94f:449e:75db with SMTP id bi7-20020a170907368700b0094f449e75dbmr28567274ejc.52.1687822279807; Mon, 26 Jun 2023 16:31:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687822279; cv=none; d=google.com; s=arc-20160816; b=ArqFvkZeQ89pejWqKf0kupWiGvGdcWhuaAObRmePdWN75R/+9ASIFVtWQRgTNp4Jd7 y8BPv0UJLEopWyGdh7Q6qsCujcSb2uI3yac/y9MJBg3qlwx6rc7GdYLvFwa0YMrNEt4f QzXb0OrVr7O8IeS70zH+VxyjGuRsrjXdX2F9m27O56pls7Pt7u6uv0+sZr0Z/3kFXkgp bnedC3Vo0pZaV+npPKdMJR8vu0lBFyT3Rrfr45NBUq8lu3lb0Hbgu7kCun8tIpaTpzho 22mlPSawYoayyQe4r0N67J+x7dkzdFz+OjjIA99XmC2FCeosoKuvt7F9+HMKKdzJ/vUz cJhA== 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=VqNI49+jqdCS3rOy3SJKCo06hHEqN29Yyi/Ri6jbvQg=; fh=IHFQlbVsC+DUr5Z3Sb1CE3j8cu6SvNBPXxR31tL4TGQ=; b=sH0/VNXaW03ciLQBFQjtiUhll/lZkayOYC/lKbgJ5qGiCikLhL6Mrf242Tcxi+ir6V TIlrt+IDlMWxItxsCFhkUpgcTTJ8ETCfPD8ZsN9OAQDhGQe/JH1jxVWQ7H9TmOWaAKas R0GjtBAxMBPPzhogvgtXKEKUzOaBpYo9KQf/vciuYbsCZzNcKkdr5BZYZcjfJNVGJ0Jv O34LlEP+1pdVW8E6QNv3KlmcrOqAuoI/xkI0UjPINiUJJdObtIXBHGMNikNCKJphGV3o vdmWc7TE6Q/AxAdHtTo31nJPxPHhcdsTmbuVFpl5elpTKtn4Crux6ktd2AsIsBLpH3lA k9Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202305 header.b=hxU83TaB; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r16-20020a170906549000b009889ae99c40si3478658ejo.611.2023.06.26.16.30.54; Mon, 26 Jun 2023 16:31:19 -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=hxU83TaB; 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 S230063AbjFZXJV (ORCPT <rfc822;filip.gregor98@gmail.com> + 99 others); Mon, 26 Jun 2023 19:09:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229748AbjFZXJO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 26 Jun 2023 19:09:14 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2F77E1701; Mon, 26 Jun 2023 16:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202305; t=1687820951; bh=+Yr5r5tG9lNpcgAHvStT9mCUIkD4YLaRJRy3M3c4Tqg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hxU83TaBoEaA02pAlqIgCfA16dHrOofbg/dUHxRm+2un6Yumd2364qaq5EXEWuAij 632S4cpDA3idsBq2OkWgVzcdLx0NLSFfFLqV4JLRbW4sRySMe0cxU9B+DABZJt+3Yi crgWARtpmWtnl0jjDkWNrTd3APkR8P4cuSRusIiLNDtMdjE2z2PlDEJLLtWcEjnIZS b1+17vzZ6LmLyx8prL6gS0LNg/Bouspz32sLX4IcYx+30+PwCXhOmVxKu063ltZFXo TcF12OEfXHCrHAO2sK3pdaXjrZOwHFewL4oQfa2GfPldDWwlcOraU0lJiTIjDQPNwe gWc8+LPpbST1A== Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 70917EEE; Tue, 27 Jun 2023 01:09:11 +0200 (CEST) Date: Tue, 27 Jun 2023 01:09:10 +0200 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= <nabijaczleweli@nabijaczleweli.xyz> To: Amir Goldstein <amir73il@gmail.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara <jack@suse.cz>, Chung-Chiang Cheng <cccheng@synology.com> Subject: [PATCH v2 2/3] splice: fsnotify_modify(fd) in vmsplice Message-ID: <raezzuhjjoddoc5tsln2bg3rkudczwou4jjfq6noeawrtn6jre@uvf4rikifzpx> References: <CAOQ4uxj_DLm8_stRJPR7i8bp9aJ5VtjzWqHL2egCTKe3M-6KSw@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sl6ezw3kqbrv7hs4" Content-Disposition: inline In-Reply-To: <CAOQ4uxj_DLm8_stRJPR7i8bp9aJ5VtjzWqHL2egCTKe3M-6KSw@mail.gmail.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769809935103700181?= X-GMAIL-MSGID: =?utf-8?q?1769809935103700181?= |
Series |
fanotify accounting for fs/splice.c
|
|
Commit Message
Ahelenia Ziemiańska
June 26, 2023, 11:09 p.m. UTC
Same logic applies here: this can fill up the pipe and pollers that rely
on getting IN_MODIFY notifications never wake up.
Fixes: 983652c69199 ("splice: report related fsnotify events")
Link: https://lore.kernel.org/linux-fsdevel/jbyihkyk5dtaohdwjyivambb2gffyjs3dodpofafnkkunxq7bu@jngkdxx65pux/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
fs/splice.c | 3 +++
1 file changed, 3 insertions(+)
Comments
On Tue, Jun 27, 2023 at 2:09 AM Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> wrote: > > Same logic applies here: this can fill up the pipe and pollers that rely > on getting IN_MODIFY notifications never wake up. > > Fixes: 983652c69199 ("splice: report related fsnotify events") > Link: https://lore.kernel.org/linux-fsdevel/jbyihkyk5dtaohdwjyivambb2gffyjs3dodpofafnkkunxq7bu@jngkdxx65pux/t/#u > Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> > --- > fs/splice.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/splice.c b/fs/splice.c > index 94fae24f9d54..a18274209dc1 100644 > --- a/fs/splice.c > +++ b/fs/splice.c > @@ -1447,6 +1447,9 @@ SYSCALL_DEFINE4(vmsplice, int, fd, const struct iovec __user *, uiov, > else > error = vmsplice_to_user(f.file, &iter, flags); > > + if (error > 0) > + fsnotify_modify(f.file); > + Wow, that is a twisted syscall, it does either write or read on the pipe depending on whether it was open for read or write. so you need to move fsnotify_modify() into vmsplice_to_pipe() and add fsnotify_access() to vmsplice_to_user(). Thanks, Amir.
diff --git a/fs/splice.c b/fs/splice.c index 94fae24f9d54..a18274209dc1 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -1447,6 +1447,9 @@ SYSCALL_DEFINE4(vmsplice, int, fd, const struct iovec __user *, uiov, else error = vmsplice_to_user(f.file, &iter, flags); + if (error > 0) + fsnotify_modify(f.file); + kfree(iov); out_fdput: fdput(f);