Whamcloud - gitweb
b=22615 fixes for regressions caused by 11063
[fs/lustre-release.git] / lustre / llite / llite_lib.c
index 142f627..77561d1 100644 (file)
@@ -1248,14 +1248,14 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr)
 
         if (ia_valid & ATTR_SIZE)
                 attr->ia_valid |= ATTR_SIZE;
-        if (ia_valid & (ATTR_SIZE | ATTR_MTIME | ATTR_MTIME_SET)) {
-                /* mtime is set to past sending setattr op to osts under PW
-                 * 0:EOF extent lock (like truncate under PW new_size:EOF), if
-                 * mtime is not set to past setattr op is not sent to osts */
-                if ((ia_valid & ATTR_SIZE) ||
-                    LTIME_S(attr->ia_mtime) < LTIME_S(attr->ia_ctime))
-                        rc = ll_setattr_ost(inode, attr);
-        }
+        if ((ia_valid & ATTR_SIZE) | 
+            ((ia_valid | ATTR_ATIME | ATTR_ATIME_SET) &&
+             LTIME_S(attr->ia_atime) < LTIME_S(attr->ia_ctime)) ||
+            ((ia_valid | ATTR_MTIME | ATTR_MTIME_SET) &&
+             LTIME_S(attr->ia_mtime) < LTIME_S(attr->ia_ctime)))
+                /* perform truncate and setting mtime/atime to past under PW
+                 * 0:EOF extent lock (new_size:EOF for truncate) */
+                rc = ll_setattr_ost(inode, attr);
         EXIT;
 out:
         if (op_data) {