aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2014-03-08 07:12:23 -0500
committerSage Weil <sage@inktank.com>2014-04-05 00:07:06 -0400
commit8c93cd610c6c5a4c0dddfc6fe906814331b3af87 (patch)
tree061a539ad1e30942ea23a7657f45bf12ea745a30
parenta255060451dcb416c8097218b40d86d613d84bfc (diff)
ceph: update i_max_size even if inode version does not change
handle following sequence of events: - client releases a inode with i_max_size > 0. The release message is queued. (is not sent to the auth MDS) - a 'lookup' request reply from non-auth MDS returns the same inode. - client opens the inode in write mode. The version of inode trace in 'open' request reply is equal to the cached inode's version. - client requests new max size. The MDS ignores the request because it does not affect client's write range Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r--fs/ceph/inode.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 91d6c9d49e3e..1a37ee77e001 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -659,14 +659,6 @@ static int fill_inode(struct inode *inode,
659 le32_to_cpu(info->time_warp_seq), 659 le32_to_cpu(info->time_warp_seq),
660 &ctime, &mtime, &atime); 660 &ctime, &mtime, &atime);
661 661
662 /* only update max_size on auth cap */
663 if ((info->cap.flags & CEPH_CAP_FLAG_AUTH) &&
664 ci->i_max_size != le64_to_cpu(info->max_size)) {
665 dout("max_size %lld -> %llu\n", ci->i_max_size,
666 le64_to_cpu(info->max_size));
667 ci->i_max_size = le64_to_cpu(info->max_size);
668 }
669
670 ci->i_layout = info->layout; 662 ci->i_layout = info->layout;
671 inode->i_blkbits = fls(le32_to_cpu(info->layout.fl_stripe_unit)) - 1; 663 inode->i_blkbits = fls(le32_to_cpu(info->layout.fl_stripe_unit)) - 1;
672 664
@@ -755,6 +747,14 @@ static int fill_inode(struct inode *inode,
755 ci->i_max_offset = 2; 747 ci->i_max_offset = 2;
756 } 748 }
757no_change: 749no_change:
750 /* only update max_size on auth cap */
751 if ((info->cap.flags & CEPH_CAP_FLAG_AUTH) &&
752 ci->i_max_size != le64_to_cpu(info->max_size)) {
753 dout("max_size %lld -> %llu\n", ci->i_max_size,
754 le64_to_cpu(info->max_size));
755 ci->i_max_size = le64_to_cpu(info->max_size);
756 }
757
758 spin_unlock(&ci->i_ceph_lock); 758 spin_unlock(&ci->i_ceph_lock);
759 759
760 /* queue truncate if we saw i_size decrease */ 760 /* queue truncate if we saw i_size decrease */