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 8EE25CA0ECF for ; Mon, 11 Sep 2023 22:21:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359410AbjIKWQa (ORCPT ); Mon, 11 Sep 2023 18:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238220AbjIKNvo (ORCPT ); Mon, 11 Sep 2023 09:51:44 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3786DFA for ; Mon, 11 Sep 2023 06:51:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E32BC433C7; Mon, 11 Sep 2023 13:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694440299; bh=oMhuhl/F1EIE13KgjlzwH8HaUbcIL3ZVAUh45OWsgsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ndj1yDKYeN4Nm1VZwhRV9TX5VtX7eJc5l5i2UHofW3Vf4bb2ssFYuUmlaM0BtvQMK Fuz01yBILctEnFX2Udqt4yf4Q6yJjTZ1nvB+OaPX5xkYaqHxorK4FbsqRYeBwHUF8B Zy2iVn5A29wrn0QvGn+en1TfKixW0ClV+a3V8DFg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Ahelenia=20Ziemia=C5=84ska?= , Jan Kara , Amir Goldstein , Christian Brauner , Sasha Levin Subject: [PATCH 6.5 013/739] splice: fsnotify_access(fd)/fsnotify_modify(fd) in vmsplice Date: Mon, 11 Sep 2023 15:36:52 +0200 Message-ID: <20230911134651.384245330@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230911134650.921299741@linuxfoundation.org> References: <20230911134650.921299741@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 6.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ahelenia Ziemiańska [ Upstream commit 7f0f1ea069e52d5a16921abd59377a7da6c25149 ] 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 Link: https://bugs.debian.org/1039488 Signed-off-by: Ahelenia Ziemiańska Acked-by: Jan Kara Reviewed-by: Amir Goldstein Message-Id: <8d9ad5acb9c5c1dd2376a2ff5da6ac3183115389.1688393619.git.nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Christian Brauner Signed-off-by: Sasha Levin --- fs/splice.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/splice.c b/fs/splice.c index 53831eb0fefa8..5f38d921dc074 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -1462,6 +1462,9 @@ static long vmsplice_to_user(struct file *file, struct iov_iter *iter, pipe_unlock(pipe); } + if (ret > 0) + fsnotify_access(file); + return ret; } @@ -1491,8 +1494,10 @@ static long vmsplice_to_pipe(struct file *file, struct iov_iter *iter, if (!ret) ret = iter_to_pipe(iter, pipe, buf_flag); pipe_unlock(pipe); - if (ret > 0) + if (ret > 0) { wakeup_pipe_readers(pipe); + fsnotify_modify(file); + } return ret; } -- 2.40.1