diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/xattr.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 93a1ab4fe1da..3e2e92d70594 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -1651,10 +1651,6 @@ static int ocfs2_xattr_set_entry(struct inode *inode, | |||
1651 | oi->ip_dyn_features |= flag; | 1651 | oi->ip_dyn_features |= flag; |
1652 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); | 1652 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); |
1653 | spin_unlock(&oi->ip_lock); | 1653 | spin_unlock(&oi->ip_lock); |
1654 | /* Update inode ctime */ | ||
1655 | inode->i_ctime = CURRENT_TIME; | ||
1656 | di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); | ||
1657 | di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); | ||
1658 | 1654 | ||
1659 | ret = ocfs2_journal_dirty(handle, xs->inode_bh); | 1655 | ret = ocfs2_journal_dirty(handle, xs->inode_bh); |
1660 | if (ret < 0) | 1656 | if (ret < 0) |
@@ -2574,6 +2570,20 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, | |||
2574 | } | 2570 | } |
2575 | } | 2571 | } |
2576 | 2572 | ||
2573 | if (!ret) { | ||
2574 | /* Update inode ctime. */ | ||
2575 | ret = ocfs2_journal_access(ctxt->handle, inode, xis->inode_bh, | ||
2576 | OCFS2_JOURNAL_ACCESS_WRITE); | ||
2577 | if (ret) { | ||
2578 | mlog_errno(ret); | ||
2579 | goto out; | ||
2580 | } | ||
2581 | |||
2582 | inode->i_ctime = CURRENT_TIME; | ||
2583 | di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); | ||
2584 | di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); | ||
2585 | ocfs2_journal_dirty(ctxt->handle, xis->inode_bh); | ||
2586 | } | ||
2577 | out: | 2587 | out: |
2578 | return ret; | 2588 | return ret; |
2579 | } | 2589 | } |
@@ -2750,6 +2760,8 @@ int ocfs2_xattr_set(struct inode *inode, | |||
2750 | goto cleanup; | 2760 | goto cleanup; |
2751 | } | 2761 | } |
2752 | 2762 | ||
2763 | /* we need to update inode's ctime field, so add credit for it. */ | ||
2764 | credits += OCFS2_INODE_UPDATE_CREDITS; | ||
2753 | ctxt.handle = ocfs2_start_trans(osb, credits); | 2765 | ctxt.handle = ocfs2_start_trans(osb, credits); |
2754 | if (IS_ERR(ctxt.handle)) { | 2766 | if (IS_ERR(ctxt.handle)) { |
2755 | ret = PTR_ERR(ctxt.handle); | 2767 | ret = PTR_ERR(ctxt.handle); |