Skip to content

Commit ef91572

Browse files
Luis Henriquesidryomov
authored andcommitted
ceph: fix snapshot directory timestamps
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]>
1 parent 9bccb76 commit ef91572

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/ceph/inode.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,14 @@ struct inode *ceph_get_snapdir(struct inode *parent)
8282
inode->i_mode = parent->i_mode;
8383
inode->i_uid = parent->i_uid;
8484
inode->i_gid = parent->i_gid;
85+
inode->i_mtime = parent->i_mtime;
86+
inode->i_ctime = parent->i_ctime;
87+
inode->i_atime = parent->i_atime;
8588
inode->i_op = &ceph_snapdir_iops;
8689
inode->i_fop = &ceph_snapdir_fops;
8790
ci->i_snap_caps = CEPH_CAP_PIN; /* so we can open */
8891
ci->i_rbytes = 0;
92+
ci->i_btime = ceph_inode(parent)->i_btime;
8993

9094
if (inode->i_state & I_NEW)
9195
unlock_new_inode(inode);

0 commit comments

Comments
 (0)