Message ID | 20230112032720.1855235-1-chao@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3673873wrt; Wed, 11 Jan 2023 19:40:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXvNM6NlRsyeGgvfgfTOR2oVrFlOJxK7d4CGJTPIYgVkgOmJMt4JMY3hc9WbA1G0AM1atj97 X-Received: by 2002:a17:90b:310f:b0:226:876c:4c57 with SMTP id gc15-20020a17090b310f00b00226876c4c57mr32785201pjb.39.1673494841319; Wed, 11 Jan 2023 19:40:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673494841; cv=none; d=google.com; s=arc-20160816; b=Cwkj3d8GNvoLHGRxfwmq5i/ODLTlPOFzYnGbwuf91BZKR7RYzwo3OfvduvrAQO1mq9 GyzgfvDMSZSVDTqZNvRefLyl5sQ7VMEut1Aqk9HztIpjUX0AVUhvXn15Q8vO5TBgdnrg Lri9AK5D5er/mKT637oqyY1KEJ6LggjLEZ8/1jENJ7IMmJtjtxo+CbAkigfi6SwhtZAD +SBp40r86LxY+23/F/l4eNsDGWA11NdVQ/dFWUAACxYl8cS8q72eVIP1PBVjp7pDSpFj 8RF3IWveNTzUXDOkgAvtQqF126LccIpSEMUVSOHu+XmSnvGOg09pFlH32AhuBLbTxThE HeBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=E7Yjy7d9NT04E/RoL2yy8JMpvtZcRfmf+laMD9Vzqgw=; b=iP9o4bfvu5sfD37JW9LW9OBB+5pfCgYgLmLfnxyPf6Mp0SOn+99bR1YFvufDFPT9sY LHt8CbsuZzkRUGj5+TesWzOT9WvhOQk4QkAeooqLP6fdEb2ePMjgjq8SXHB/GZeGdlrG bCKyuJYaW8FmPO/CYs4oLEG4rPXQyzCInyXbniAyAx/LL1SboK+TV9XpN/K35N9w4Dww QovhZq1hvuzC6cXyveGCRUL9qYhWz52XmOwvsLwD1EyO00wOZZrq4XX9/7ocORbJVSLm h7LwgExM48jr1WuqYr9OIbqqOhGmLufvrTX94X/e9X4m6YAaBSEpQTOhFIyloKoDiIu5 iiUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SuLKKKXQ; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx12-20020a17090b4b0c00b00225b5d6a297si17775145pjb.65.2023.01.11.19.40.29; Wed, 11 Jan 2023 19:40:41 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=SuLKKKXQ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235948AbjALD2J (ORCPT <rfc822;syz17693488234@gmail.com> + 99 others); Wed, 11 Jan 2023 22:28:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235934AbjALD2G (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 11 Jan 2023 22:28:06 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF6EBC77E; Wed, 11 Jan 2023 19:28:05 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 722BC60EDF; Thu, 12 Jan 2023 03:28:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36B4BC433EF; Thu, 12 Jan 2023 03:28:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673494084; bh=lTrL5/cdFLCbDI8M14ACxzOpG64h6TOm1e5TM5oaG8I=; h=From:To:Cc:Subject:Date:From; b=SuLKKKXQTK1aBWxAOxtHYlxjQ3v6LBXH3CDjpmjeB+VOX0JVHkNxuMGYpwDFF68UB 2dZ4oTgEeL3A0FPoa33qMC6LFW8uv8N8pmm82n0sUA+9NOeEaslmwT/7PHpc7rJowW MkwEcDsRZ4OUvJL6ATwVl09dAA7losV9u90t3y1qrFKwdY9zaq+Qo1oIi5j/JCZT+q aORRJ84pKWyFiwVIJOtGM+2kGsurbDxtSBuc2CcEubzWno5XLzpqZpg2nm8WsvAybo hzXYr+S92t3Bmc/TMr9rj/zcPAtI6N141dZvIAWnPtRJRpZ/BMcxbjA5zhZzbs3n52 rhtPxwGWwwLng== From: Chao Yu <chao@kernel.org> To: akpm@linux-foundation.org, adobriyan@gmail.com Cc: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Chao Yu <chao@kernel.org> Subject: [PATCH] proc: remove mark_inode_dirty() in proc_notify_change() Date: Thu, 12 Jan 2023 11:27:20 +0800 Message-Id: <20230112032720.1855235-1-chao@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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?1754786526516503075?= X-GMAIL-MSGID: =?utf-8?q?1754786526516503075?= |
Series |
proc: remove mark_inode_dirty() in proc_notify_change()
|
|
Commit Message
Chao Yu
Jan. 12, 2023, 3:27 a.m. UTC
proc_notify_change() has updated i_uid, i_gid and i_mode into proc
dirent, we don't need to call mark_inode_dirty() for later writeback,
remove it.
Signed-off-by: Chao Yu <chao@kernel.org>
---
fs/proc/generic.c | 1 -
1 file changed, 1 deletion(-)
Comments
On Thu, 12 Jan 2023 11:27:20 +0800 Chao Yu <chao@kernel.org> wrote: > proc_notify_change() has updated i_uid, i_gid and i_mode into proc > dirent, we don't need to call mark_inode_dirty() for later writeback, > remove it. > > --- a/fs/proc/generic.c > +++ b/fs/proc/generic.c > @@ -127,7 +127,6 @@ static int proc_notify_change(struct user_namespace *mnt_userns, > return error; > > setattr_copy(&init_user_ns, inode, iattr); > - mark_inode_dirty(inode); > > proc_set_user(de, inode->i_uid, inode->i_gid); > de->mode = inode->i_mode; procfs call mark_inode_dirty() in three places. Does mark_inode_dirty() of a procfs file actually serve any purpose?
Hi Andrew, Sorry for the long delay. :( On 2023/1/13 6:43, Andrew Morton wrote: > On Thu, 12 Jan 2023 11:27:20 +0800 Chao Yu <chao@kernel.org> wrote: > >> proc_notify_change() has updated i_uid, i_gid and i_mode into proc >> dirent, we don't need to call mark_inode_dirty() for later writeback, >> remove it. >> >> --- a/fs/proc/generic.c >> +++ b/fs/proc/generic.c >> @@ -127,7 +127,6 @@ static int proc_notify_change(struct user_namespace *mnt_userns, >> return error; >> >> setattr_copy(&init_user_ns, inode, iattr); >> - mark_inode_dirty(inode); >> >> proc_set_user(de, inode->i_uid, inode->i_gid); >> de->mode = inode->i_mode; > > procfs call mark_inode_dirty() in three places. Correct. > > Does mark_inode_dirty() of a procfs file actually serve any purpose? I don't see any particular reason that procfs inode needs to be set dirty, as an in-memory filesystem, there is no backing device, so all attributes should have been updated into procfs dirent directly in .setattr(). In fact, also procfs doesn't implement .dirty_inode, .write_inode or .writepage{,s} interfaces which serves delayed inode update, pages writeback after inode is set as dirty. Thanks,
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 5f52f20d5ed1..f547e9593a77 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -127,7 +127,6 @@ static int proc_notify_change(struct user_namespace *mnt_userns, return error; setattr_copy(&init_user_ns, inode, iattr); - mark_inode_dirty(inode); proc_set_user(de, inode->i_uid, inode->i_gid); de->mode = inode->i_mode;