Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125902
b: refs/heads/master
c: 4b3f620
h: refs/heads/master
v: v3
  • Loading branch information
Tao Ma authored and Mark Fasheh committed Jan 5, 2009
1 parent 0ade685 commit 069cf15
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 71d548a6af36fe98c95fbd0522147f842bd5f054
refs/heads/master: 4b3f6209bf9eec46fe5ebb168718fef5c443c157
20 changes: 16 additions & 4 deletions trunk/fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1651,10 +1651,6 @@ static int ocfs2_xattr_set_entry(struct inode *inode,
oi->ip_dyn_features |= flag;
di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features);
spin_unlock(&oi->ip_lock);
/* Update inode ctime */
inode->i_ctime = CURRENT_TIME;
di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec);
di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec);

ret = ocfs2_journal_dirty(handle, xs->inode_bh);
if (ret < 0)
Expand Down Expand Up @@ -2574,6 +2570,20 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
}
}

if (!ret) {
/* Update inode ctime. */
ret = ocfs2_journal_access(ctxt->handle, inode, xis->inode_bh,
OCFS2_JOURNAL_ACCESS_WRITE);
if (ret) {
mlog_errno(ret);
goto out;
}

inode->i_ctime = CURRENT_TIME;
di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec);
di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec);
ocfs2_journal_dirty(ctxt->handle, xis->inode_bh);
}
out:
return ret;
}
Expand Down Expand Up @@ -2750,6 +2760,8 @@ int ocfs2_xattr_set(struct inode *inode,
goto cleanup;
}

/* we need to update inode's ctime field, so add credit for it. */
credits += OCFS2_INODE_UPDATE_CREDITS;
ctxt.handle = ocfs2_start_trans(osb, credits);
if (IS_ERR(ctxt.handle)) {
ret = PTR_ERR(ctxt.handle);
Expand Down

0 comments on commit 069cf15

Please sign in to comment.