Commit 5c308356 authored by Jeff Layton's avatar Jeff Layton Committed by Ilya Dryomov

ceph: increment change_attribute on local changes

We don't set SB_I_VERSION on ceph since we need to manage it ourselves,
so we must increment it whenever we update the file times.
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 176c77c9
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/pagevec.h> #include <linux/pagevec.h>
#include <linux/task_io_accounting_ops.h> #include <linux/task_io_accounting_ops.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/iversion.h>
#include "super.h" #include "super.h"
#include "mds_client.h" #include "mds_client.h"
...@@ -1576,6 +1577,7 @@ static vm_fault_t ceph_page_mkwrite(struct vm_fault *vmf) ...@@ -1576,6 +1577,7 @@ static vm_fault_t ceph_page_mkwrite(struct vm_fault *vmf)
/* Update time before taking page lock */ /* Update time before taking page lock */
file_update_time(vma->vm_file); file_update_time(vma->vm_file);
inode_inc_iversion_raw(inode);
do { do {
lock_page(page); lock_page(page);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/namei.h> #include <linux/namei.h>
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/falloc.h> #include <linux/falloc.h>
#include <linux/iversion.h>
#include "super.h" #include "super.h"
#include "mds_client.h" #include "mds_client.h"
...@@ -1435,6 +1436,8 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from) ...@@ -1435,6 +1436,8 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
if (err) if (err)
goto out; goto out;
inode_inc_iversion_raw(inode);
if (ci->i_inline_version != CEPH_INLINE_NONE) { if (ci->i_inline_version != CEPH_INLINE_NONE) {
err = ceph_uninline_data(file, NULL); err = ceph_uninline_data(file, NULL);
if (err < 0) if (err < 0)
...@@ -2064,6 +2067,8 @@ static ssize_t ceph_copy_file_range(struct file *src_file, loff_t src_off, ...@@ -2064,6 +2067,8 @@ static ssize_t ceph_copy_file_range(struct file *src_file, loff_t src_off,
do_final_copy = true; do_final_copy = true;
file_update_time(dst_file); file_update_time(dst_file);
inode_inc_iversion_raw(dst_inode);
if (endoff > size) { if (endoff > size) {
int caps_flags = 0; int caps_flags = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment