From patchwork Wed Jul 19 13:50:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 13319016 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0E838C001E0 for ; Wed, 19 Jul 2023 13:51:11 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qM7a8-0008LN-M4; Wed, 19 Jul 2023 13:51:09 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qM7a6-0008LH-Uo for linux-f2fs-devel@lists.sourceforge.net; Wed, 19 Jul 2023 13:51:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fM797S7MSHVf/ppIVilql+u6327Hw9wj9qKjgqMcrag=; b=fNw2ekBRS8aVNIAYx00FZJ0XLx yDHmKv97rqmRoeiINN0uPcxl0Ct6As1z3j4eKrJYk1A8e1OPwAeQMx62vduW187Z3RtLPOO98XEZS ux97mIU6v0ZPcjMIZpZt6iMh3fHa0JKrwNX72nmpSwUxsT7UYWTffY+eQwp+WhMvq5/4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=fM797S7MSHVf/ppIVilql+u6327Hw9wj9qKjgqMcrag=; b=E UK7dpn4KIWf+G/xmOHfmOjm8Rg/UkoAF+HNZ+Pts658UcHJlw18VyTXC5Qk46VPKMsd/llr2y4nFK GKSuEa6ct13JvqIWoaB9s5CMuzBPGqXY2FSIYt5qZ2ldeQBMWFAiQ1xTEn7S/28QIexe+6hsbIUTH rWrXHf5mXhMJzJaM=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qM7a4-00CzSB-F7 for linux-f2fs-devel@lists.sourceforge.net; Wed, 19 Jul 2023 13:51:07 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 30F81612D3 for ; Wed, 19 Jul 2023 13:50:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24012C433C8; Wed, 19 Jul 2023 13:50:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689774652; bh=eTOECLHt5+G+o9Vzad3QTBIsWxNKNRHb3k78HAMje+8=; h=From:To:Cc:Subject:Date:From; b=Y2O5BFAoZ2CHTqSqwUJ+RPN9ykaUQawY0y4u8GAS36D4HWhlinDsm4+7QPOKx24q5 bWywxYLgM+Fiz41q9cAkeu1U5vuXrCcRzNHMyhHzOIYVhax2+T6X2hdKhWBC2pULjp HKgjEr8Sk7U7FopdiTWnW25uU3rK6ZgfqF0JAHcTJpXL+jAQvXE1yRkMzb47E7QoBy GLvFDLiBTA6tMoTUTqUy7o/9trJJyc9K8tYBdSvnLg+sfIBUauYuw2HepkDS9pXALW FzC4BGe5kvZ9c5p+vO1vr2DqI3LlKEJ+zBQcOxyhAZxrs/C8NpFoZeaoQ/QvqM/0em d0Ux4ToiuYyAw== From: Chao Yu To: jaegeuk@kernel.org Date: Wed, 19 Jul 2023 21:50:45 +0800 Message-Id: <20230719135047.2947030-1-chao@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Headers-End: 1qM7a4-00CzSB-F7 Subject: [f2fs-dev] [PATCH 1/2] f2fs: fix to update i_ctime in __f2fs_setxattr() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net generic/728 - output mismatch (see /media/fstests/results//generic/728.out.bad) --- tests/generic/728.out 2023-07-19 07:10:48.362711407 +0000 +++ /media/fstests/results//generic/728.out.bad 2023-07-19 08:39:57.000000000 +0000 QA output created by 728 +Expected ctime to change after setxattr. +Expected ctime to change after removexattr. Silence is golden ... (Run 'diff -u /media/fstests/tests/generic/728.out /media/fstests/results//generic/728.out.bad' to see the entire diff) generic/729 1s It needs to update i_ctime after {set,remove}xattr, fix it. Signed-off-by: Chao Yu --- fs/f2fs/xattr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 476b186b90a6..71bfa2391ab4 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -757,17 +757,17 @@ static int __f2fs_setxattr(struct inode *inode, int index, if (index == F2FS_XATTR_INDEX_ENCRYPTION && !strcmp(name, F2FS_XATTR_NAME_ENCRYPTION_CONTEXT)) f2fs_set_encrypted_inode(inode); - f2fs_mark_inode_dirty_sync(inode, true); if (!error && S_ISDIR(inode->i_mode)) set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_CP); same: if (is_inode_flag_set(inode, FI_ACL_MODE)) { inode->i_mode = F2FS_I(inode)->i_acl_mode; - inode->i_ctime = current_time(inode); clear_inode_flag(inode, FI_ACL_MODE); } + inode->i_ctime = current_time(inode); + f2fs_mark_inode_dirty_sync(inode, true); exit: kfree(base_addr); return error;