From: vs Date: Thu, 23 Oct 2008 14:19:58 +0000 (+0000) Subject: b=11063 X-Git-Tag: v1_7_130~1^8 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7638bc2896cc74bb54b316c7550342ea07e2a363;p=fs%2Flustre-release.git b=11063 i=green,vitaly this patch reverses https://bugzilla.lustre.org/attachment.cgi?id=7933 https://bugzilla.lustre.org/attachment.cgi?id=7882 https://bugzilla.lustre.org/attachment.cgi?id=15831 and replaces them with setting mtime to past under extent lock sanity test (39c) is added to check original problem i=adilger,grev --- diff --git a/lustre/obdclass/linux/linux-obdo.c b/lustre/obdclass/linux/linux-obdo.c index 04155cc..3c85ae4 100644 --- a/lustre/obdclass/linux/linux-obdo.c +++ b/lustre/obdclass/linux/linux-obdo.c @@ -220,16 +220,10 @@ void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid) if (valid & OBD_MD_FLATIME && src->o_atime > LTIME_S(dst->i_atime)) LTIME_S(dst->i_atime) = src->o_atime; - - /* mtime is always updated with ctime, but can be set in past. - As write and utime(2) may happen within 1 second, and utime's - mtime has a priority over write's one, leave mtime from mds - for the same ctimes. */ - if (valid & OBD_MD_FLCTIME && src->o_ctime > LTIME_S(dst->i_ctime)) { + if (valid & OBD_MD_FLMTIME && src->o_mtime > LTIME_S(dst->i_mtime)) + LTIME_S(dst->i_mtime) = src->o_mtime; + if (valid & OBD_MD_FLCTIME && src->o_ctime > LTIME_S(dst->i_ctime)) LTIME_S(dst->i_ctime) = src->o_ctime; - if (valid & OBD_MD_FLMTIME) - LTIME_S(dst->i_mtime) = src->o_mtime; - } if (valid & OBD_MD_FLSIZE) i_size_write(dst, src->o_size); /* optimum IO size */