Whamcloud - gitweb
LU-9470 osc: update timestamps on write only 48/27348/3
authorNiu Yawei <yawei.niu@intel.com>
Wed, 31 May 2017 07:51:26 +0000 (03:51 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 3 Jun 2017 03:59:52 +0000 (03:59 +0000)
In osc_io_submit(), we should only update timestamps on write.

Test-parameters: testlist=sanityn.sh,sanityn.sh,sanityn.sh,sanityn.sh,sanityn.sh,sanityn.sh
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I56ed4c499f3b438018ff5b4cd29d7e84f72e04a6
Reviewed-on: https://review.whamcloud.com/27348
Tested-by: Jenkins
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osc/osc_io.c

index 1ab41d8..0501ba5 100644 (file)
@@ -211,7 +211,7 @@ static int osc_io_submit(const struct lu_env *env,
                result = osc_queue_sync_pages(env, osc, &list, cmd, brw_flags);
 
        /* Update c/mtime for sync write. LU-7310 */
-       if (qout->pl_nr > 0 && result == 0) {
+       if (crt == CRT_WRITE && qout->pl_nr > 0 && result == 0) {
                struct cl_object *obj   = ios->cis_obj;
                struct cl_attr *attr = &osc_env_info(env)->oti_attr;