[PATCH 18/23] staging/lustre/mdt: set ATTR_xTIME_SET to make atime update properly

Peng Tao bergwolf at gmail.com
Fri May 31 17:23:08 UTC 2013


From: Emoly Liu <emoly.liu at intel.com>

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().

Intel-bug-id: LU-3036
Lustre-commit: 565b6203761a09b28f6aee08c4dd4a5f6dbaf4f1
Lustre-change: http://review.whamcloud.com/6327
Signed-off-by: Liu Ying <emoly.liu at intel.com>
Reviewed-by: Fan Yong <fan.yong at intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger at intel.com>

[updated for upstream kernel submission]
Signed-off-by: Peng Tao <tao.peng at emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger at intel.com>
---
 drivers/staging/lustre/lustre/llite/file.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index 5bb2367..be42317 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -95,8 +95,9 @@ static void ll_prepare_close(struct inode *inode, struct md_op_data *op_data,
 {
 	ENTRY;
 
-	op_data->op_attr.ia_valid = ATTR_MODE | ATTR_ATIME_SET |
-				 ATTR_MTIME_SET | ATTR_CTIME_SET;
+	op_data->op_attr.ia_valid = ATTR_MODE | ATTR_ATIME | ATTR_ATIME_SET |
+					ATTR_MTIME | ATTR_MTIME_SET |
+					ATTR_CTIME | ATTR_CTIME_SET;
 
 	if (!(och->och_flags & FMODE_WRITE))
 		goto out;
-- 
1.7.9.5




More information about the devel mailing list