X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fliblustre%2Fsuper.c;h=7be70b9c7489f544e882d177b4b487c5b4ac668d;hp=cdd12ecfa8e44b5336ace572ab1b189e74bc3afa;hb=9d9b3fa84a5fafe7ea0906b5cdae3be119a62b25;hpb=dfd8433e6f6376bf5f7a50020bb484adfe48ce2c diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index cdd12ec..7be70b9 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -840,14 +840,16 @@ int llu_setattr_raw(struct inode *inode, struct iattr *attr) inode_setattr(inode, attr); } - 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 = cl_setattr_ost(inode, attr, NULL); - } + if (ia_valid & ATTR_SIZE) + attr->ia_valid |= ATTR_SIZE; + 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 = cl_setattr_ost(inode, attr, NULL); EXIT; out: if (op_data.op_ioepoch)