From 06e92a2ee437c1a81c815129b1d188af0b4fa84e Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Mon, 24 Jun 2019 13:06:49 +0530 Subject: ctime: Set mdata xattr on legacy files Problem: The files which were created before ctime enabled would not have "trusted.glusterfs.mdata"(stores time attributes) xattr. Upon fops which modifies either ctime or mtime, the xattr gets created with latest ctime, mtime and atime, which is incorrect. It should update only the corresponding time attribute and rest from backend Solution: Creating xattr with values from brick is not possible as each brick of replica set would have different times. So create the xattr upon successful lookup if the xattr is not created Note To Reviewers: The time attributes used to set xattr is got from successful lookup. Instead of sending the whole iatt over the wire via setxattr, a structure called mdata_iatt is sent. The mdata_iatt contains only time attributes. Change-Id: I5e535631ddef04195361ae0364336410a2895dd4 fixes: bz#1593542 Signed-off-by: Kotresh HR --- xlators/storage/posix/src/posix-metadata.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/storage/posix/src/posix-metadata.h') diff --git a/xlators/storage/posix/src/posix-metadata.h b/xlators/storage/posix/src/posix-metadata.h index 3416148ea97..dc25e59c66a 100644 --- a/xlators/storage/posix/src/posix-metadata.h +++ b/xlators/storage/posix/src/posix-metadata.h @@ -53,5 +53,9 @@ posix_set_ctime_cfr(call_frame_t *frame, xlator_t *this, const char *real_path_in, int fd_in, inode_t *inode_in, struct iatt *stbuf_in, const char *read_path_put, int fd_out, inode_t *inode_out, struct iatt *stbuf_out); +int +posix_set_mdata_xattr_legacy_files(xlator_t *this, inode_t *inode, + struct mdata_iatt *mdata_iatt, + int *op_errno); #endif /* _POSIX_METADATA_H */ -- cgit