Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84fcc2d2 authored by Geng, Jichao's avatar Geng, Jichao Committed by Ilya Dryomov
Browse files

ceph: fix get_oldest_context()



For no snapshot case, we should use ci->truncate_{seq,size}.

Fixes: 5f743e45 ("ceph: record truncate size/seq for snap data writeback")
Signed-off-by: default avatarGeng, Jichao <geng.jichao@h3c.com>
Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
parent cc8e8342
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -502,9 +502,9 @@ static struct ceph_snap_context *get_oldest_context(struct inode *inode,
		dout(" head snapc %p has %d dirty pages\n",
		dout(" head snapc %p has %d dirty pages\n",
		     snapc, ci->i_wrbuffer_ref_head);
		     snapc, ci->i_wrbuffer_ref_head);
		if (truncate_size)
		if (truncate_size)
			*truncate_size = capsnap->truncate_size;
			*truncate_size = ci->i_truncate_size;
		if (truncate_seq)
		if (truncate_seq)
			*truncate_seq = capsnap->truncate_seq;
			*truncate_seq = ci->i_truncate_seq;
	}
	}
	spin_unlock(&ci->i_ceph_lock);
	spin_unlock(&ci->i_ceph_lock);
	return snapc;
	return snapc;