From: adilger Date: Sat, 19 Jul 2003 06:09:32 +0000 (+0000) Subject: Fix mtime corruption bug 1570. Was checking wrong valid flags, after X-Git-Tag: v1_7_110~1^13~171 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=0fde85bf6c3c952b85b8044af6ce2cedf818f049;p=fs%2Flustre-release.git Fix mtime corruption bug 1570. Was checking wrong valid flags, after setting them for truncates. --- diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 82392f1..821e6fe 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -582,15 +582,15 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr) } /* We mark all of the fields "set" so MDS/OST does not re-set them */ - if (ia_valid & ATTR_CTIME) { + if (attr->ia_valid & ATTR_CTIME) { attr->ia_ctime = now; attr->ia_valid |= ATTR_CTIME_SET; } - if (!(ia_valid & ATTR_ATIME_SET) && (ia_valid & ATTR_ATIME)) { + if (!(ia_valid & ATTR_ATIME_SET) && (attr->ia_valid & ATTR_ATIME)) { attr->ia_atime = now; attr->ia_valid |= ATTR_ATIME_SET; } - if (!(ia_valid & ATTR_MTIME_SET) && (ia_valid & ATTR_MTIME)) { + if (!(ia_valid & ATTR_MTIME_SET) && (attr->ia_valid & ATTR_MTIME)) { attr->ia_mtime = now; attr->ia_valid |= ATTR_MTIME_SET; }