From: Xiubo Li <xiubli@xxxxxxxxxx> Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx> --- fs/ceph/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index a2ff964e332b..6788a1f88eb6 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -2301,7 +2301,6 @@ static int fill_fscrypt_truncate(struct inode *inode, pos = orig_pos; ret = __ceph_sync_read(inode, &pos, &iter, &retry_op, &objver); - ceph_put_cap_refs(ci, got); if (ret < 0) goto out; @@ -2365,6 +2364,7 @@ static int fill_fscrypt_truncate(struct inode *inode, out: dout("%s %p size dropping cap refs on %s\n", __func__, inode, ceph_cap_string(got)); + ceph_put_cap_refs(ci, got); kunmap_local(iov.iov_base); if (page) __free_pages(page, 0); -- 2.27.0