diff options
author | Kotresh HR <khiremat@redhat.com> | 2019-06-24 13:06:49 +0530 |
---|---|---|
committer | Rinku Kothiya <rkothiya@redhat.com> | 2019-08-19 11:27:14 +0000 |
commit | 8d2aebf93baed6f8555cd02545d6f95da59cc7f3 (patch) | |
tree | 1ea84070457dea886fd46d33e3fd69812ff5eb02 /rpc/xdr/src/glusterfs4-xdr.x | |
parent | 8b7ceb3934f8e2dbcbabe5d1c0244c2bacda92c3 (diff) |
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 <khiremat@redhat.com>
Change-Id: I5e535631ddef04195361ae0364336410a2895dd4
updates: bz#1739430
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'rpc/xdr/src/glusterfs4-xdr.x')
-rw-r--r-- | rpc/xdr/src/glusterfs4-xdr.x | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rpc/xdr/src/glusterfs4-xdr.x b/rpc/xdr/src/glusterfs4-xdr.x index 6d13aafc9eb..30597850e23 100644 --- a/rpc/xdr/src/glusterfs4-xdr.x +++ b/rpc/xdr/src/glusterfs4-xdr.x @@ -46,6 +46,16 @@ struct gfx_iattx { unsigned int mode; /* type of file and rwx mode */ }; +struct gfx_mdata_iatt { + hyper ia_atime; /* last access time */ + hyper ia_mtime; /* last modification time */ + hyper ia_ctime; /* last status change time */ + + unsigned int ia_atime_nsec; + unsigned int ia_mtime_nsec; + unsigned int ia_ctime_nsec; +}; + union gfx_value switch (gf_dict_data_type_t type) { case GF_DATA_TYPE_INT: hyper value_int; @@ -62,6 +72,8 @@ union gfx_value switch (gf_dict_data_type_t type) { case GF_DATA_TYPE_PTR: case GF_DATA_TYPE_STR_OLD: opaque other<>; + case GF_DATA_TYPE_MDATA: + gfx_mdata_iatt mdata_iatt; }; /* AUTH */ |