Patch "overlayfs: set ctime when setting mtime and atime" has been added to the 5.4-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

    overlayfs: set ctime when setting mtime and atime

to the 5.4-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:
     overlayfs-set-ctime-when-setting-mtime-and-atime.patch
and it can be found in the queue-5.4 subdirectory.

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



commit d84da84ff4b0a514b56857ecc07aaec8ea2ff30d
Author: Jeff Layton <jlayton@xxxxxxxxxx>
Date:   Wed Sep 13 09:33:12 2023 -0400

    overlayfs: set ctime when setting mtime and atime
    
    [ Upstream commit 03dbab3bba5f009d053635c729d1244f2c8bad38 ]
    
    Nathan reported that he was seeing the new warning in
    setattr_copy_mgtime pop when starting podman containers. Overlayfs is
    trying to set the atime and mtime via notify_change without also
    setting the ctime.
    
    POSIX states that when the atime and mtime are updated via utimes() that
    we must also update the ctime to the current time. The situation with
    overlayfs copy-up is analogies, so add ATTR_CTIME to the bitmask.
    notify_change will fill in the value.
    
    Reported-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
    Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Acked-by: Christian Brauner <brauner@xxxxxxxxxx>
    Acked-by: Amir Goldstein <amir73il@xxxxxxxxx>
    Message-Id: <20230913-ctime-v1-1-c6bc509cbc27@xxxxxxxxxx>
    Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index 1bfd1660a66c0..9e5223108362d 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -192,7 +192,7 @@ static int ovl_set_timestamps(struct dentry *upperdentry, struct kstat *stat)
 {
 	struct iattr attr = {
 		.ia_valid =
-		     ATTR_ATIME | ATTR_MTIME | ATTR_ATIME_SET | ATTR_MTIME_SET,
+		     ATTR_ATIME | ATTR_MTIME | ATTR_ATIME_SET | ATTR_MTIME_SET | ATTR_CTIME,
 		.ia_atime = stat->atime,
 		.ia_mtime = stat->mtime,
 	};



[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