]> Git Repo - linux.git/commitdiff
ceph: fix snapshot directory timestamps
authorLuis Henriques <[email protected]>
Wed, 11 Mar 2020 11:05:38 +0000 (11:05 +0000)
committerIlya Dryomov <[email protected]>
Mon, 30 Mar 2020 10:42:43 +0000 (12:42 +0200)
The .snap directory timestamps are kept at 0 (1970-01-01 00:00), which
isn't consistent with what the fuse client does.  This patch makes the
behaviour consistent, by setting these timestamps (atime, btime, ctime,
mtime) to those of the parent directory.

Cc: Marc Roos <[email protected]>
Signed-off-by: Luis Henriques <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
fs/ceph/inode.c

index ee40ba7e0e770c5840b181a760107a00b58274f6..7fef94fd1e55fdbabbb77deecd3df5400e4f749c 100644 (file)
@@ -82,10 +82,14 @@ struct inode *ceph_get_snapdir(struct inode *parent)
        inode->i_mode = parent->i_mode;
        inode->i_uid = parent->i_uid;
        inode->i_gid = parent->i_gid;
+       inode->i_mtime = parent->i_mtime;
+       inode->i_ctime = parent->i_ctime;
+       inode->i_atime = parent->i_atime;
        inode->i_op = &ceph_snapdir_iops;
        inode->i_fop = &ceph_snapdir_fops;
        ci->i_snap_caps = CEPH_CAP_PIN; /* so we can open */
        ci->i_rbytes = 0;
+       ci->i_btime = ceph_inode(parent)->i_btime;
 
        if (inode->i_state & I_NEW)
                unlock_new_inode(inode);
This page took 0.069903 seconds and 4 git commands to generate.