From 173ec95d89244f169af778677fbc508843d83ef4 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. Backport of: > Patch: https://review.gluster.org/22936 > Change-Id: I5e535631ddef04195361ae0364336410a2895dd4 > BUG: 1593542 > Signed-off-by: Kotresh HR Change-Id: I5e535631ddef04195361ae0364336410a2895dd4 updates: bz#1733885 Signed-off-by: Kotresh HR --- libglusterfs/src/glusterfs/glusterfs.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libglusterfs/src/glusterfs/glusterfs.h') diff --git a/libglusterfs/src/glusterfs/glusterfs.h b/libglusterfs/src/glusterfs/glusterfs.h index 3056a61d9af..cded97835a6 100644 --- a/libglusterfs/src/glusterfs/glusterfs.h +++ b/libglusterfs/src/glusterfs/glusterfs.h @@ -229,6 +229,9 @@ enum gf_internal_fop_indicator { #define VIRTUAL_QUOTA_XATTR_CLEANUP_KEY "glusterfs.quota-xattr-cleanup" #define QUOTA_READ_ONLY_KEY "trusted.glusterfs.quota.read-only" +/* ctime related */ +#define CTIME_MDATA_XDATA_KEY "set-ctime-mdata" + /* afr related */ #define AFR_XATTR_PREFIX "trusted.afr" -- cgit