Commit f57d9a72 authored by Emoly Liu's avatar Emoly Liu Committed by Greg Kroah-Hartman

staging/lustre/mdt: set ATTR_xTIME_SET to make atime update properly

To make atime update properly between 1.8 client and 2.x server,
this patch includes the following fixes:
- if MDS_ATTR_xTIME is set without MDS_ATTR_xTIME_SET and the client
  does not have OBD_CONNECT_FULL20, convert it to LA_xTIME in
  mdt_setattr_unpack().
- set both MDS_ATTR_xTIME | MDS_ATTR_xTIME_SET for timestamps in
  ll_prepare_close(). This allows us to fix the server-side timestamp
  setting in the future.
- remove attr_unpack() and convert the flags from MDS_ATTR_ to LA_*
  directly in mdt_attr_valid_xlate() instead.
- improve sanityn.sh test_23().

[picked llite part for upstream kernel submission]
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3036
Lustre-change: http://review.whamcloud.com/6327Signed-off-by: default avatarLiu Ying <emoly.liu@intel.com>
Reviewed-by: default avatarFan Yong <fan.yong@intel.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarPeng Tao <tao.peng@emc.com>
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e11b0b16
...@@ -95,8 +95,9 @@ static void ll_prepare_close(struct inode *inode, struct md_op_data *op_data, ...@@ -95,8 +95,9 @@ static void ll_prepare_close(struct inode *inode, struct md_op_data *op_data,
{ {
ENTRY; ENTRY;
op_data->op_attr.ia_valid = ATTR_MODE | ATTR_ATIME_SET | op_data->op_attr.ia_valid = ATTR_MODE | ATTR_ATIME | ATTR_ATIME_SET |
ATTR_MTIME_SET | ATTR_CTIME_SET; ATTR_MTIME | ATTR_MTIME_SET |
ATTR_CTIME | ATTR_CTIME_SET;
if (!(och->och_flags & FMODE_WRITE)) if (!(och->och_flags & FMODE_WRITE))
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment