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; From patchwork Wed Jul 19 13:50:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 13319015 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 03D6EEB64DA for ; Wed, 19 Jul 2023 13:51:10 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qM7aA-00052R-EK; Wed, 19 Jul 2023 13:51:09 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qM7a9-00052L-32 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:References: In-Reply-To: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZFez3G9iZwTDX9MwhqfV3uWTzMROT16heX9xDgJmM5w=; b=a9QWZf+HAzkOfptqV0wNQQF7+G NEefp0GbPG9gKI9MKu2abV9D6/HRWZBuclvj6pLe+OchN+vfB89iWhb+ydyBeYUCTTo+jPtKIEjVB EaBufmAX9XCPWQbP2KFI748780VQbdaZ2noWKxKlME7yAU/YnD5MVavHMarKTsW8SYug=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ZFez3G9iZwTDX9MwhqfV3uWTzMROT16heX9xDgJmM5w=; b=jbHdd75ux22yh+S2G8h35tYbtG C9/XPaivF7F9mm0yKfAVdqXBSArjFDf5x27CQn0WTHvTpdWJO38w/QL+Vnbm1IKS5sJGYmPS4Gqus NHFAwendY9/v09Ncfpgj+7OcLC8NF6IokZmLa0Cn3tigjEzduAemrjDIJV9UIvp0B5IU=; 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-00CzSD-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 D290E6167A for ; Wed, 19 Jul 2023 13:50:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2E81C433C7; Wed, 19 Jul 2023 13:50:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689774654; bh=jxSEIgFFgOG/2+9mEHtdiwLWFjzU1BfBqEW1cWXN2HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZYhfHhirwP+IqwIhtU2G4WJc0ZWbF9nXm9soVIzoHF02McjRI5GfC4rG3jm1QGQqK l6ClKF/zYBPX8v4gRfU+iVV5QIgUu8rOxTXTpgGJkCjzBhlm3o0e/2gbPwemooAV/w P/dG6uMokDNnTvmy8FoFRWUZkuT3DeIPRrSsiG+ymqYVzw40smpQpCZq8xA8AQUbJS 1VL5x+GKGDxSnyeeTWU0dg5FhGlyMNw9E5U6FCR3SzNmJ8Uc9MEC2zabXxqcAOUkdN GHYyLWi+3p/v6kcmtDlvg17QZGXqt9VCrKZ6NIrCrulw1pXNOqyjKjFAVsGEgrm3sO zaJI1dpPRHsOA== From: Chao Yu To: jaegeuk@kernel.org Date: Wed, 19 Jul 2023 21:50:46 +0800 Message-Id: <20230719135047.2947030-2-chao@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230719135047.2947030-1-chao@kernel.org> References: <20230719135047.2947030-1-chao@kernel.org> MIME-Version: 1.0 X-Headers-End: 1qM7a4-00CzSD-F7 Subject: [f2fs-dev] [PATCH 2/2] f2fs: remove unneeded check condition 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 It has checked return value of write_all_xattrs(), remove unneeded following check condition. Signed-off-by: Chao Yu --- fs/f2fs/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 71bfa2391ab4..9cc1ca75b2da 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -757,7 +757,7 @@ 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); - if (!error && S_ISDIR(inode->i_mode)) + if (S_ISDIR(inode->i_mode)) set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_CP); same: