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 BE111CCA480 for ; Fri, 3 Jun 2022 10:48:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD4A78D0002; Fri, 3 Jun 2022 06:48:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C82F98D0001; Fri, 3 Jun 2022 06:48:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B6C1F8D0002; Fri, 3 Jun 2022 06:48:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A433C8D0001 for ; Fri, 3 Jun 2022 06:48:33 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6D724215B9 for ; Fri, 3 Jun 2022 10:48:33 +0000 (UTC) X-FDA: 79536600906.03.2DA1D3F Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf23.hostedemail.com (Postfix) with ESMTP id 3BDC614009A for ; Fri, 3 Jun 2022 10:48:06 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 26D0621BAF; Fri, 3 Jun 2022 10:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1654253308; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lL0sA5XjtLFXOSPYhZwL9fsYRctZLSHfZMiugzXEhy0=; b=MPG+EDLZ7zWtvgYAuhwBRZAbEQTvwn0S2ojkdsEWGzgDARk6FtZCjTh6LDLjkoAh1HAeN1 qLdFYFKplq7W9P08Xhuw0g0LCJVECJgSB6rKoueH+O4alAy0avP5ZySJH0mkHhLwkCpn5C z7KWS13dFbs4yhmJFUkRSLpn/FLQ6gg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1654253308; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lL0sA5XjtLFXOSPYhZwL9fsYRctZLSHfZMiugzXEhy0=; b=virjceIuMs1e0WcsnZvBKAq6RwjObIP8bs1bt75KotsmFk5fqGF4hiId5i+c8xrxXcVouG cD1xxqDFti5G2ZAg== Received: from quack3.suse.cz (unknown [10.100.224.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id BB5F02C141; Fri, 3 Jun 2022 10:48:27 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id F3E10A0633; Fri, 3 Jun 2022 12:12:02 +0200 (CEST) Date: Fri, 3 Jun 2022 12:12:02 +0200 From: Jan Kara To: Stefan Roesch Cc: Jan Kara , 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, hch@infradead.org, axboe@kernel.dk, Christoph Hellwig Subject: Re: [PATCH v7 10/15] fs: Add async write file modification handling. Message-ID: <20220603101202.sabns7qs4cv4z2yp@quack3.lan> References: <20220601210141.3773402-1-shr@fb.com> <20220601210141.3773402-11-shr@fb.com> <20220602090605.ulwxr4edbrsgdxtl@quack3.lan> <06c41c2d-4265-3dad-ad97-755ade33a8fa@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <06c41c2d-4265-3dad-ad97-755ade33a8fa@fb.com> X-Stat-Signature: hywukb8oxrg5k8ft9pep9cmxp1tcua61 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=MPG+EDLZ; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=virjceIu; dmarc=none; spf=pass (imf23.hostedemail.com: domain of jack@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=jack@suse.cz X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 3BDC614009A X-HE-Tag: 1654253286-595316 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 Thu 02-06-22 14:00:38, Stefan Roesch wrote: > > > On 6/2/22 2:06 AM, Jan Kara wrote: > > On Wed 01-06-22 14:01:36, Stefan Roesch wrote: > >> This adds a file_modified_async() function 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 of io-uring. > >> > >> Signed-off-by: Stefan Roesch > >> Reviewed-by: Christoph Hellwig > > > > I've found one small bug here: > > > >> diff --git a/fs/inode.c b/fs/inode.c > >> index c44573a32c6a..4503bed063e7 100644 > >> --- a/fs/inode.c > >> +++ b/fs/inode.c > > ... > >> -int file_modified(struct file *file) > >> +static int file_modified_flags(struct file *file, int flags) > >> { > >> int ret; > >> struct inode *inode = file_inode(file); > > > > We need to use 'flags' for __file_remove_privs_flags() call in this patch. > > > > I assume that you meant that the function should not be called _file_remove_privs(), > but instead file_remove_privs_flags(). Is that correct? No, I meant that patch 8 adds call __file_remove_privs(..., 0) to file_modified() and this patch then forgets to update that call to __file_remove_privs(..., flags) so that information propagates properly. Honza -- Jan Kara SUSE Labs, CR