Although, mmap-write of ceph update the time of file using
file_update_time.Because it don't mark the relative cap so the time
can't save.

Signed-off-by: Jianpeng Ma <[email protected]>
---
 fs/ceph/addr.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 38b5c1b..52f7c7c 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1231,10 +1231,18 @@ static int ceph_page_mkwrite(struct vm_area_struct 
*vma, struct vm_fault *vmf)
 
        ret = ceph_update_writeable_page(vma->vm_file, off, len, page);
        if (ret == 0) {
+               int dirty;
+               struct ceph_inode_info *ci = ceph_inode(inode);
                /* success.  we'll keep the page locked. */
                set_page_dirty(page);
                up_read(&mdsc->snap_rwsem);
                ret = VM_FAULT_LOCKED;
+
+               spin_lock(&ci->i_ceph_lock);
+               dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_WR);
+               spin_unlock(&ci->i_ceph_lock);
+               if (dirty)
+                       __mark_inode_dirty(inode, dirty);
        } else {
                if (ret == -ENOMEM)
                        ret = VM_FAULT_OOM;
-- 
1.8.1.2

Reply via email to