Patch "f2fs: fix to update i_ctime in __f2fs_setxattr()" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    f2fs: fix to update i_ctime in __f2fs_setxattr()

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     f2fs-fix-to-update-i_ctime-in-__f2fs_setxattr.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 56b19b1a54746a4bf7e67b30b61dc5b2968a1bf0
Author: Chao Yu <chao@xxxxxxxxxx>
Date:   Wed Jul 19 21:50:45 2023 +0800

    f2fs: fix to update i_ctime in __f2fs_setxattr()
    
    [ Upstream commit 8874ad7dae8d91d24cc87c545c0073b3b2da5688 ]
    
    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 <chao@xxxxxxxxxx>
    Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
    Stable-dep-of: aaf8c0b9ae04 ("f2fs: reduce expensive checkpoint trigger frequency")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
index 4271bcc2738d1..a3a11678d414d 100644
--- a/fs/f2fs/xattr.c
+++ b/fs/f2fs/xattr.c
@@ -756,17 +756,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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux