Skip to content

Commit

Permalink
ceph: fix get_oldest_context()
Browse files Browse the repository at this point in the history
For no snapshot case, we should use ci->truncate_{seq,size}.

Fixes: 5f743e4 ("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>
  • Loading branch information
Geng, Jichao authored and Ilya Dryomov committed Jan 12, 2017
1 parent cc8e834 commit 84fcc2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ static struct ceph_snap_context *get_oldest_context(struct inode *inode,
dout(" head snapc %p has %d dirty pages\n",
snapc, ci->i_wrbuffer_ref_head);
if (truncate_size)
*truncate_size = capsnap->truncate_size;
*truncate_size = ci->i_truncate_size;
if (truncate_seq)
*truncate_seq = capsnap->truncate_seq;
*truncate_seq = ci->i_truncate_seq;
}
spin_unlock(&ci->i_ceph_lock);
return snapc;
Expand Down

0 comments on commit 84fcc2d

Please sign in to comment.