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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90633C433EF for ; Wed, 27 Apr 2022 12:07:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C81A6B0073; Wed, 27 Apr 2022 08:07:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 150AB6B0078; Wed, 27 Apr 2022 08:07:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0CBC6B0080; Wed, 27 Apr 2022 08:07:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id E35836B0073 for ; Wed, 27 Apr 2022 08:07:32 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id AD67912267C for ; Wed, 27 Apr 2022 12:07:32 +0000 (UTC) X-FDA: 79402534344.24.7190DF5 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf28.hostedemail.com (Postfix) with ESMTP id 3EBF2C0053 for ; Wed, 27 Apr 2022 12:07:24 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id CA8E6CE2235; Wed, 27 Apr 2022 12:07:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51833C385A9; Wed, 27 Apr 2022 12:07:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651061247; bh=VfXSpAbry2B4XiKgswh2qeTUbT/mzrWFYlX4Tdrzl6g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b2Xc1pJMOg84lf+VdPwO2jdpef2Yn9NTMPROLKoVrRFo6Kk/UV8eOY7I9p3+NS8Tb uk+qKrL57LCpm9jwGXODz+78Dw+WUuBBoYo/oZW8gqZ6ZW/bhE8noxkCRargA7v1Rs YJCOYz9aWD8OFH+8HEAJnH5GzSRm9aI7tMSn8jmoY2YajiGwjrdBXtygGj7ezXadfX PT0YDagK6RUCGgGe2uyXIdbhq20JCuYza/CV1yYGkX0k+qSTN3GXOc3XYhy00vgN72 DGSdxh+IPYONxQDaGFJooizFy2FZ70uMrcz6VfIEiqC6ZksVy3PC8QNi0AFR2ZQ0AE qq6bw9p0zg/ig== Date: Wed, 27 Apr 2022 14:07:21 +0200 From: Christian Brauner To: Stefan Roesch Cc: io-uring@vger.kernel.org, kernel-team@fb.com, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, david@fromorbit.com Subject: Re: [RFC PATCH v1 10/18] xfs: Enable async write file modification handling. Message-ID: <20220427120721.55tde42m4wsjgkfl@wittgenstein> References: <20220426174335.4004987-1-shr@fb.com> <20220426174335.4004987-11-shr@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220426174335.4004987-11-shr@fb.com> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3EBF2C0053 X-Stat-Signature: sj3udiput7a3dgb7n1tjkwtpywj6eab9 X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=b2Xc1pJM; spf=pass (imf28.hostedemail.com: domain of brauner@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=brauner@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1651061244-912375 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Apr 26, 2022 at 10:43:27AM -0700, Stefan Roesch wrote: > This modifies xfs write checks to return -EAGAIN if the request either > requires to remove privileges or needs to update the file modification > time. This is required for async buffered writes, so the request gets > handled in the io worker. > > Signed-off-by: Stefan Roesch > --- > fs/xfs/xfs_file.c | 39 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > > diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c > index 5bddb1e9e0b3..6f9da1059e8b 100644 > --- a/fs/xfs/xfs_file.c > +++ b/fs/xfs/xfs_file.c > @@ -299,6 +299,43 @@ xfs_file_read_iter( > return ret; > } > > +static int xfs_file_modified(struct file *file, int flags) This should probably be in fs/inode.c as: int file_modified_async(struct file *file, int flags) and then file_modified() can simply become: int file_modified(struct file *file) { return file_modified_async(file, 0); } or even: int file_modified_async(struct file *file, bool async) int file_modified(struct file *file) { return file_modified_async(file, false); } to avoid piecing this together specifically in xfs (as Dave mentioned this is all pretty generic).