FAILED: patch "[PATCH] ceph: always update atime/mtime/ctime for new inode" failed to apply to 4.14-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
ffdeec7aa41aa61ca4ee68fddf4669df9ce661d1Mon Sep 17 00:00:00 2001
From: "Yan, Zheng" <[email protected]>
Date: Mon, 26 Mar 2018 16:46:39 +0800
Subject: [PATCH] ceph: always update atime/mtime/ctime for new inode
For new inode, atime/mtime/ctime are uninitialized. Don't compare against them.
Signed-off-by "Yan, Zheng" <[email protected]>
Reviewed-by Ilya Dryomov <[email protected]>
Signed-off-by Ilya Dryomov <[email protected]>
fs/ceph/inode.c +7 -3
@@ -669,13 +669,15 @@ void ceph_fill_file_time(struct inode *inode, int issued, CEPH_CAP_FILE_BUFFER| CEPH_CAP_AUTH_EXCL| CEPH_CAP_XATTR_EXCL)) { -if (timespec_compare (ctime, &inode->i_ctime) >0 ) { +if (ci->i_version ==0 || +timespec_compare (ctime, &inode->i_ctime) >0 ) {dout ("ctime %ld.%09ld -> %ld.%09ld inc w/ cap\n" , inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, ctime->tv_sec, ctime->tv_nsec); inode->i_ctime = *ctime; } -if (ceph_seq_cmp (time_warp_seq, ci->i_time_warp_seq) >0 ) { +if (ci->i_version ==0 || +ceph_seq_cmp (time_warp_seq, ci->i_time_warp_seq) >0 ) {/* the MDS did a utimes() */ dout("mtime %ld.%09ld -> %ld.%09ld " "tw %d -> %d\n",
@@ -795,7 +797,6 @@ static int fill_inode(struct inode *inode, struct page *locked_page, new_issued = ~issued &le32_to_cpu (info->cap.caps);/* update inode */ - ci->i_version =le64_to_cpu (info->version); inode->i_rdev =le32_to_cpu (info->rdev); inode->i_blkbits =fls (le32_to_cpu (info->layout.fl_stripe_unit)) -1 ;
@@ -868,6 +869,9 @@ static int fill_inode(struct inode *inode, struct page *locked_page, xattr_blob =NULL ; } +/* finally update i_version */ + ci->i_version =le64_to_cpu (info->version); + inode->i_mapping->a_ops = &ceph_aops;switch (inode->i_mode &S_IFMT ) {