From: Yan, Zheng Date: Wed, 23 Jan 2019 03:20:00 +0000 (+0800) Subject: ceph: touch existing cap when handling reply X-Git-Tag: v5.4-rc1~1411^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32f6511a69eb36db9c6b9d77b8429837079f73b6;p=platform%2Fkernel%2Flinux-rpi.git ceph: touch existing cap when handling reply Move cap to tail of session->s_caps list. So ceph_trim_caps() will trim older caps first. Signed-off-by: "Yan, Zheng" Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index da5b56e..6fbdc1a 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -657,6 +657,10 @@ void ceph_add_cap(struct inode *inode, session->s_nr_caps++; spin_unlock(&session->s_cap_lock); } else { + spin_lock(&session->s_cap_lock); + list_move_tail(&cap->session_caps, &session->s_caps); + spin_unlock(&session->s_cap_lock); + if (cap->cap_gen < session->s_cap_gen) cap->issued = cap->implemented = CEPH_CAP_PIN;