From patchwork Mon Nov 11 20:18:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13871233 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E224ED3ABF5 for ; Mon, 11 Nov 2024 20:19:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E0D26B00A7; Mon, 11 Nov 2024 15:19:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 88E9C6B00A8; Mon, 11 Nov 2024 15:19:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 709756B00A9; Mon, 11 Nov 2024 15:19:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 497DF6B00A7 for ; Mon, 11 Nov 2024 15:19:38 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 000FA121A93 for ; Mon, 11 Nov 2024 20:19:37 +0000 (UTC) X-FDA: 82774928880.11.FDB4E10 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) by imf26.hostedemail.com (Postfix) with ESMTP id 47608140024 for ; Mon, 11 Nov 2024 20:19:05 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b="D54r+mM/"; spf=none (imf26.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.45) smtp.mailfrom=josef@toxicpanda.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731356184; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=K354FbH7N36y1HXaBsHf/k0mJrRSZmAsPpq48Ppw2zw=; b=lVbNEZpDTHeELNShgXggtSEcdUQMRcEXUPwI1XItPaVmqxT5sNMQAsqSj0HKiHzbi70icX STO3sBRXy+RYeYwuAMou6pUb0fo949mtpvTksu5XHnyllLdNT4kVABxRmgOzhhoPIFqoyy FaiLfEZ3L/MR++QaGemls91uEZ3TD58= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b="D54r+mM/"; spf=none (imf26.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.45) smtp.mailfrom=josef@toxicpanda.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731356184; a=rsa-sha256; cv=none; b=Dss/5bxCxWdRjX8LVeDM1X4esnxgAelYhh5XW6AYeD2c07EoXIp6GFU0ZIq1MkiuIpqcBZ USth5sKBtGoDi1XC5XXnYZw6re22MC4WBKkcHKmRwmSH6aVp8k/DDK3RnFwwTyBsyvXDCy 7cAddUTaEcvB/HWRSwHOQ3DWDJL2xwg= Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-6cc03b649f2so31868486d6.3 for ; Mon, 11 Nov 2024 12:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1731356375; x=1731961175; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=K354FbH7N36y1HXaBsHf/k0mJrRSZmAsPpq48Ppw2zw=; b=D54r+mM/WwQpN2eff8wNcQlgAaIJ0oql2tg9imSpxcnx28NRVpgrmA0noQKHDi25v9 UURLT6SQTmi4IEHkfm1RVxSuzMur1461K7lFP25rCeEi/zBiKSjEQkK19r0TfteMD82X MK3B6Ja6BtF9BJvyTz9rxzWgztUyGshZ4RbnO/p/b5KqfGaADEDvhF1QLRqGLVUDlrgD QzRMz2Ejt2kmXU1L/UMUM9OnLhYufA/quXApg72A9q28bn1FnoNsuWcanSEerzHxdQHW 1HCgIw2ErOKnvCDe+MoVLGqAbMuOuD73p7QvkVQpsZlhzDa+UMdwxus9ifuRATvPFohX ufdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731356375; x=1731961175; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K354FbH7N36y1HXaBsHf/k0mJrRSZmAsPpq48Ppw2zw=; b=pf49LlaPVncFhH1CYyQHCzLDnBCBFReJd32aTZaMj8dcERAB9mwujndlqhRbjPri2b 1AWj2ilnpn2XJyiQwWNwqvhynn9UIhaAs+uZvv6BnpQSDlkoM0k6/K3JyE+bcQCFzogU N24Did7pkbgiVLMFANKfV81CBsJIZKA53VbzhGtKSoW4LsiqK9EmZ7OwYKvOBkD1JZVb s5SG7jQZahKL/LScLtAlivq/pJ1Y1avXvZ43nzY52rH/rD1z3Vv4m0olsvv77AN3lDc1 EG0IX1YFEvB0u6vsxKBMLyWmOgoa/u8jEMeHYNYPgRdZf2vVbbDlBFgbxK32iW885p3U FLew== X-Forwarded-Encrypted: i=1; AJvYcCUWH1MmUEA+Y0hd3FfXVDwZ0n0/PFaOMnhQlvN76IIc0MyYHEq7L7LujGovN6tb6hUlSmWqtd4efw==@kvack.org X-Gm-Message-State: AOJu0YzN2bAaLTK1pzLoMuZnSh9FS4oS/8ka1s2gbFuESONdeRpMmI1O 9fAQ3SuY2RZNRw80DXOrQzOt7MjANpCzNaH6Y3du+GTpSAIWLH6f98yIrKmWE9E= X-Google-Smtp-Source: AGHT+IHFQZuz+k/JoyCiK5HhS+saKZlDM8Ru8ImET04ZPdGlwroC1m2336uogkksO+jSLPZVucywhA== X-Received: by 2002:a05:6214:4518:b0:6cb:5273:7265 with SMTP id 6a1803df08f44-6d39e1800c0mr180760506d6.20.1731356375457; Mon, 11 Nov 2024 12:19:35 -0800 (PST) Received: from localhost (syn-076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d3961df2d2sm63665716d6.25.2024.11.11.12.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 12:19:34 -0800 (PST) From: Josef Bacik To: kernel-team@fb.com, linux-fsdevel@vger.kernel.org, jack@suse.cz, amir73il@gmail.com, brauner@kernel.org, torvalds@linux-foundation.org, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org Subject: [PATCH v6 15/17] xfs: add pre-content fsnotify hook for write faults Date: Mon, 11 Nov 2024 15:18:04 -0500 Message-ID: <339a520d48acf1c8dc736460d09fd240201d6e00.1731355931.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 47608140024 X-Stat-Signature: r6z7wa7skwd88bf18qys3353yajfjip8 X-Rspam-User: X-HE-Tag: 1731356345-617756 X-HE-Meta: U2FsdGVkX19ac1SwYMdlBkDGJzJqtGlwDtWt1itzKMJtapYOsaSQiObLDjVhYutl6DkX1lsm4+faVBWYoMifX516eTpakUJdCdfPwfeJQtdrm2Hgh/OAvxv4cjkrujc/UvXm4mEqeG07hNse3dqZdi3pHC30q1bIQxKFETjeEKQr2Us8+797RaU33DF7PxTdHXFwVHICyLMKMBy0viIPzTO/AhNR530QQYHSzKAt6Kb79ZU8ca8/oStAumSFlGOOzX/zHmZvJMm7s4JbtT1XZX2gp8U1AitwUA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== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: xfs has it's own handling for write faults, so we need to add the pre-content fsnotify hook for this case. Reads go through filemap_fault so they're handled properly there. Signed-off-by: Josef Bacik --- fs/xfs/xfs_file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index b19916b11fd5..d1966f996c77 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -1442,6 +1442,10 @@ xfs_write_fault( unsigned int lock_mode = XFS_MMAPLOCK_SHARED; vm_fault_t ret; + ret = filemap_fsnotify_fault(vmf); + if (unlikely(ret)) + return ret; + sb_start_pagefault(inode->i_sb); file_update_time(vmf->vma->vm_file);