*t = inode->i_ctime;
rc = inode->i_op->setxattr(dentry, name, buf->lb_buf,
buf->lb_len, fs_flags);
- if (likely(rc == 0)) {
- spin_lock(&obj->oo_guard);
- inode->i_ctime = *t;
- spin_unlock(&obj->oo_guard);
- mark_inode_dirty(inode);
- }
+ /* ctime should not be updated with server-side time. */
+ spin_lock(&obj->oo_guard);
+ inode->i_ctime = *t;
+ spin_unlock(&obj->oo_guard);
+ mark_inode_dirty(inode);
return rc;
}
dentry->d_inode = inode;
*t = inode->i_ctime;
rc = inode->i_op->removexattr(dentry, name);
- if (likely(rc == 0)) {
- /* ctime should not be updated with server-side time. */
- spin_lock(&obj->oo_guard);
- inode->i_ctime = *t;
- spin_unlock(&obj->oo_guard);
- mark_inode_dirty(inode);
- }
+ /* ctime should not be updated with server-side time. */
+ spin_lock(&obj->oo_guard);
+ inode->i_ctime = *t;
+ spin_unlock(&obj->oo_guard);
+ mark_inode_dirty(inode);
return rc;
}
(char *)key, strlen((char *)key));
bh = ldiskfs_find_entry(dentry, &de);
if (bh) {
+ struct osd_thread_info *oti = osd_oti_get(env);
+ struct timespec *ctime = &oti->oti_time;
+ struct timespec *mtime = &oti->oti_time2;
+
+ *ctime = dir->i_ctime;
+ *mtime = dir->i_mtime;
rc = ldiskfs_delete_entry(oh->ot_handle,
dir, de, bh);
- if (!rc)
- mark_inode_dirty(dir);
+ /* xtime should not be updated with server-side time. */
+ spin_lock(&obj->oo_guard);
+ dir->i_ctime = *ctime;
+ dir->i_mtime = *mtime;
+ spin_unlock(&obj->oo_guard);
+ mark_inode_dirty(dir);
brelse(bh);
} else
rc = -ENOENT;
const char *name = (const char *)key;
struct osd_object *child;
#ifdef HAVE_QUOTA_SUPPORT
- cfs_cap_t save = current->cap_effective;
+ cfs_cap_t save = current->cap_effective;
#endif
int rc;
RETURN(rc);
child = osd_object_find(env, dt, fid);
if (!IS_ERR(child)) {
+ struct inode *inode = obj->oo_inode;
+ struct osd_thread_info *oti = osd_oti_get(env);
+ struct timespec *ctime = &oti->oti_time;
+ struct timespec *mtime = &oti->oti_time2;
+
+ *ctime = inode->i_ctime;
+ *mtime = inode->i_mtime;
#ifdef HAVE_QUOTA_SUPPORT
if (ignore_quota)
current->cap_effective |= CFS_CAP_SYS_RESOURCE_MASK;
current->cap_effective = save;
#endif
osd_object_put(env, child);
+ /* xtime should not be updated with server-side time. */
+ spin_lock(&obj->oo_guard);
+ inode->i_ctime = *ctime;
+ inode->i_mtime = *mtime;
+ spin_unlock(&obj->oo_guard);
+ mark_inode_dirty(inode);
} else {
rc = PTR_ERR(child);
}
* XXX temporary: for ->i_op calls.
*/
struct txn_param oti_txn;
- /*
- * XXX temporary: fake dentry used by xattr calls.
- */
struct timespec oti_time;
+ struct timespec oti_time2;
/*
* XXX temporary: fake struct file for osd_object_sync
*/
setup_56 $NUMFILES $NUMDIRS
TDIR=$DIR/${tdir}g
- utime $TDIR/file1 > /dev/null || error
- utime $TDIR/file2 > /dev/null || error
- utime $TDIR/dir1 > /dev/null || error
- utime $TDIR/dir2 > /dev/null || error
- utime $TDIR/dir1/file1 > /dev/null || error
+ utime $TDIR/file1 > /dev/null || error "utime (1)"
+ utime $TDIR/file2 > /dev/null || error "utime (2)"
+ utime $TDIR/dir1 > /dev/null || error "utime (3)"
+ utime $TDIR/dir2 > /dev/null || error "utime (4)"
+ utime $TDIR/dir1/file1 > /dev/null || error "utime (5)"
EXPECTED=5
NUMS=`$LFIND -mtime +1 $TDIR | wc -l`
int rc;
int c;
- utb.actime = 200000;
- utb.modtime = 100000;
-
while ((c = getopt(argc, argv, "s:")) != -1) {
switch(c) {
case 's':
}
if (st.st_mtime < before_mknod || st.st_mtime > after_mknod) {
- fprintf(stderr,
- "%s: bad mknod times %lu <= %lu <= %lu false\n",
- prog, before_mknod, st.st_mtime, after_mknod);
+ fprintf(stderr, "%s: bad mknod(%s) times %lu <= %lu <= "
+ "%lu false\n", prog, filename, before_mknod,
+ st.st_mtime, after_mknod);
return 4;
}
if (st2.st_mtime < before_mknod ||
st2.st_mtime > after_mknod) {
- fprintf(stderr, "%s: bad mknod times %lu <= %lu"
- " <= %lu false\n", prog, before_mknod,
- st2.st_mtime, after_mknod);
+ fprintf(stderr, "%s: bad mknod(%s) times %lu "
+ " <= %lu <= %lu false\n", prog,
+ filename, before_mknod, st2.st_mtime,
+ after_mknod);
return 6;
}
}
}
- /* See above */
+ utb.actime = 200000;
+ utb.modtime = 100000;
rc = utime(filename, &utb);
if (rc) {
fprintf(stderr, "%s: utime(%s) failed: rc %d: %s\n",
}
if (st.st_mtime != utb.modtime ) {
- fprintf(stderr, "%s: bad utime mtime %lu should be %lu\n",
- prog, st.st_mtime, utb.modtime);
+ fprintf(stderr, "%s: bad utime mtime(%s) %lu should be %lu\n",
+ prog, filename, st.st_mtime, utb.modtime);
return 9;
}
if (st.st_atime != utb.actime ) {
- fprintf(stderr, "%s: bad utime atime %lu should be %lu\n",
- prog, st.st_atime, utb.actime);
+ fprintf(stderr, "%s: bad utime atime(%s) %lu should be %lu\n",
+ prog, filename, st.st_atime, utb.actime);
return 10;
}
}
if (st2.st_mtime != st.st_mtime) {
- fprintf(stderr, "%s: not synced mtime between clients: %lu "
- "should be %lu\n", prog, st2.st_mtime, st.st_mtime);
+ fprintf(stderr, "%s: not synced mtime(%s) between clients: "
+ "%lu should be %lu\n", prog, secname,
+ st2.st_mtime, st.st_mtime);
return 13;
}
if (st2.st_ctime != st.st_ctime) {
- fprintf(stderr, "%s: not synced ctime between clients: %lu "
- " should be %lu\n", prog, st2.st_ctime, st.st_ctime);
+ fprintf(stderr, "%s: not synced ctime(%s) between clients: "
+ "%lu should be %lu\n", prog, secname,
+ st2.st_ctime, st.st_ctime);
return 14;
}