aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeng, Jichao <geng.jichao@h3c.com>2017-01-05 03:50:39 -0500
committerIlya Dryomov <idryomov@gmail.com>2017-01-12 13:31:01 -0500
commit84fcc2d2bd6cbf621e49e1d0f7eaef2e3c666b40 (patch)
tree6fb8f91a59da31402086e60e89554a2de820e702
parentcc8e8342930129aa2c9b629e1653e4681f0896ea (diff)
ceph: fix get_oldest_context()
For no snapshot case, we should use ci->truncate_{seq,size}. Fixes: 5f743e456606 ("ceph: record truncate size/seq for snap data writeback") Signed-off-by: Geng, Jichao <geng.jichao@h3c.com> Signed-off-by: Yan, Zheng <zyan@redhat.com>
-rw-r--r--fs/ceph/addr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 9cd0c0ea7cdb..e4b066cd912a 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -502,9 +502,9 @@ static struct ceph_snap_context *get_oldest_context(struct inode *inode,
502 dout(" head snapc %p has %d dirty pages\n", 502 dout(" head snapc %p has %d dirty pages\n",
503 snapc, ci->i_wrbuffer_ref_head); 503 snapc, ci->i_wrbuffer_ref_head);
504 if (truncate_size) 504 if (truncate_size)
505 *truncate_size = capsnap->truncate_size; 505 *truncate_size = ci->i_truncate_size;
506 if (truncate_seq) 506 if (truncate_seq)
507 *truncate_seq = capsnap->truncate_seq; 507 *truncate_seq = ci->i_truncate_seq;
508 } 508 }
509 spin_unlock(&ci->i_ceph_lock); 509 spin_unlock(&ci->i_ceph_lock);
510 return snapc; 510 return snapc;