Skip to content

Commit 84fcc2d

Browse files
Geng, Jichaoidryomov
Geng, Jichao
authored andcommitted
ceph: fix get_oldest_context()
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 <[email protected]> Signed-off-by: Yan, Zheng <[email protected]>
1 parent cc8e834 commit 84fcc2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/ceph/addr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,9 @@ static struct ceph_snap_context *get_oldest_context(struct inode *inode,
502502
dout(" head snapc %p has %d dirty pages\n",
503503
snapc, ci->i_wrbuffer_ref_head);
504504
if (truncate_size)
505-
*truncate_size = capsnap->truncate_size;
505+
*truncate_size = ci->i_truncate_size;
506506
if (truncate_seq)
507-
*truncate_seq = capsnap->truncate_seq;
507+
*truncate_seq = ci->i_truncate_seq;
508508
}
509509
spin_unlock(&ci->i_ceph_lock);
510510
return snapc;

0 commit comments

Comments
 (0)