Whamcloud - gitweb
Branch b1_8
authordzogin <dzogin>
Wed, 2 Sep 2009 14:30:33 +0000 (14:30 +0000)
committerdzogin <dzogin>
Wed, 2 Sep 2009 14:30:33 +0000 (14:30 +0000)
 b=20146
 i=andrew.perepechko
 i=adilger
 Modified Files:
  Tag: b1_8
        lustre/ChangeLog lustre/mds/mds_reint.c

Description: Do not update ctime for the deleted inode.
Details    : Check in mds_reint_unlink() before calling fsfilt_setattr().

lustre/ChangeLog
lustre/mds/mds_reint.c

index 3c4fdc1..1263de6 100644 (file)
@@ -15,6 +15,11 @@ tbd Sun Microsystems, Inc.
          more information, please refer to bugzilla 17630.
 
 Severity   : normal
+Bugzilla   : 20146
+Description: Do not update ctime for the deleted inode.
+Details    : Check in mds_reint_unlink() before calling fsfilt_setattr().
+
+Severity   : normal
 Bugzilla   : 14951
 Description: Improved cleanup procedure for conf-sanity test_46a.
 
index 9b2f964..ae52b78 100644 (file)
@@ -2062,14 +2062,17 @@ cleanup:
                 struct iattr iattr;
                 int err;
 
-                /* update ctime of unlinked file, even if last link is
-                   removed because open-unlinked file can be statted */
-                iattr.ia_valid = ATTR_CTIME;
-                LTIME_S(iattr.ia_ctime) = rec->ur_time;
-                err = fsfilt_setattr(obd, dchild, handle, &iattr, 0);
-                if (err)
-                        CERROR("error on unlinked inode time update: "
-                               "rc = %d\n", err);
+                if (child_inode->i_nlink > 0 ||
+                    mds_orphan_open_count(child_inode) > 0) {
+                        /* update ctime of unlinked file only if it is still
+                         * opened or a link still exists */
+                        iattr.ia_valid = ATTR_CTIME;
+                        LTIME_S(iattr.ia_ctime) = rec->ur_time;
+                        err = fsfilt_setattr(obd, dchild, handle, &iattr, 0);
+                        if (err)
+                                CERROR("error on unlinked inode time update: "
+                                       "rc = %d\n", err);
+                }
 
                 /* update mtime and ctime of parent directory*/
                 iattr.ia_valid = ATTR_MTIME | ATTR_CTIME;