ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ceph: flush cap release on session flush
@ 2023-02-07  5:04 xiubli
  2023-02-07  5:16 ` Venky Shankar
  2023-02-07 12:48 ` Jeff Layton
  0 siblings, 2 replies; 5+ messages in thread
From: xiubli @ 2023-02-07  5:04 UTC (permalink / raw)
  To: idryomov, ceph-devel
  Cc: jlayton, mchangir, vshankar, lhenriques, Xiubo Li, stable,
	Patrick Donnelly

From: Xiubo Li <xiubli@redhat.com>

MDS expects the completed cap release prior to responding to the
session flush for cache drop.

Cc: <stable@kernel.org>
URL: http://tracker.ceph.com/issues/38009
Cc: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 fs/ceph/mds_client.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 3c9d3f609e7f..51366bd053de 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -4039,6 +4039,12 @@ static void handle_session(struct ceph_mds_session *session,
 		break;
 
 	case CEPH_SESSION_FLUSHMSG:
+		/* flush cap release */
+		spin_lock(&session->s_cap_lock);
+		if (session->s_num_cap_releases)
+			ceph_flush_cap_releases(mdsc, session);
+		spin_unlock(&session->s_cap_lock);
+
 		send_flushmsg_ack(mdsc, session, seq);
 		break;
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ceph: flush cap release on session flush
  2023-02-07  5:04 [PATCH] ceph: flush cap release on session flush xiubli
@ 2023-02-07  5:16 ` Venky Shankar
  2023-02-07  5:19   ` Xiubo Li
  2023-02-07 12:48 ` Jeff Layton
  1 sibling, 1 reply; 5+ messages in thread
From: Venky Shankar @ 2023-02-07  5:16 UTC (permalink / raw)
  To: xiubli
  Cc: idryomov, ceph-devel, jlayton, mchangir, lhenriques, stable,
	Patrick Donnelly

On Tue, Feb 7, 2023 at 10:35 AM <xiubli@redhat.com> wrote:
>
> From: Xiubo Li <xiubli@redhat.com>
>
> MDS expects the completed cap release prior to responding to the
> session flush for cache drop.
>
> Cc: <stable@kernel.org>
> URL: http://tracker.ceph.com/issues/38009
> Cc: Patrick Donnelly <pdonnell@redhat.com>
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  fs/ceph/mds_client.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index 3c9d3f609e7f..51366bd053de 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -4039,6 +4039,12 @@ static void handle_session(struct ceph_mds_session *session,
>                 break;
>
>         case CEPH_SESSION_FLUSHMSG:
> +               /* flush cap release */
> +               spin_lock(&session->s_cap_lock);
> +               if (session->s_num_cap_releases)
> +                       ceph_flush_cap_releases(mdsc, session);
> +               spin_unlock(&session->s_cap_lock);
> +
>                 send_flushmsg_ack(mdsc, session, seq);
>                 break;

Ugh. kclient never flushed cap releases o_O

LGTM.

Reviewed-by: Venky Shankar <vshankar@redhat.com>

>
> --
> 2.31.1
>


-- 
Cheers,
Venky


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ceph: flush cap release on session flush
  2023-02-07  5:16 ` Venky Shankar
@ 2023-02-07  5:19   ` Xiubo Li
  2023-02-07 16:03     ` Ilya Dryomov
  0 siblings, 1 reply; 5+ messages in thread
From: Xiubo Li @ 2023-02-07  5:19 UTC (permalink / raw)
  To: Venky Shankar
  Cc: idryomov, ceph-devel, jlayton, mchangir, lhenriques, stable,
	Patrick Donnelly


On 07/02/2023 13:16, Venky Shankar wrote:
> On Tue, Feb 7, 2023 at 10:35 AM <xiubli@redhat.com> wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> MDS expects the completed cap release prior to responding to the
>> session flush for cache drop.
>>
>> Cc: <stable@kernel.org>
>> URL: http://tracker.ceph.com/issues/38009
>> Cc: Patrick Donnelly <pdonnell@redhat.com>
>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
>> ---
>>   fs/ceph/mds_client.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
>> index 3c9d3f609e7f..51366bd053de 100644
>> --- a/fs/ceph/mds_client.c
>> +++ b/fs/ceph/mds_client.c
>> @@ -4039,6 +4039,12 @@ static void handle_session(struct ceph_mds_session *session,
>>                  break;
>>
>>          case CEPH_SESSION_FLUSHMSG:
>> +               /* flush cap release */
>> +               spin_lock(&session->s_cap_lock);
>> +               if (session->s_num_cap_releases)
>> +                       ceph_flush_cap_releases(mdsc, session);
>> +               spin_unlock(&session->s_cap_lock);
>> +
>>                  send_flushmsg_ack(mdsc, session, seq);
>>                  break;
> Ugh. kclient never flushed cap releases o_O

Yeah, I think this was missed before.

> LGTM.
>
> Reviewed-by: Venky Shankar <vshankar@redhat.com>

Thanks Venky.

>> --
>> 2.31.1
>>
>
-- 
Best Regards,

Xiubo Li (李秀波)

Email: xiubli@redhat.com/xiubli@ibm.com
Slack: @Xiubo Li


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ceph: flush cap release on session flush
  2023-02-07  5:04 [PATCH] ceph: flush cap release on session flush xiubli
  2023-02-07  5:16 ` Venky Shankar
@ 2023-02-07 12:48 ` Jeff Layton
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Layton @ 2023-02-07 12:48 UTC (permalink / raw)
  To: xiubli, idryomov, ceph-devel
  Cc: mchangir, vshankar, lhenriques, stable, Patrick Donnelly

On Tue, 2023-02-07 at 13:04 +0800, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
> 
> MDS expects the completed cap release prior to responding to the
> session flush for cache drop.
> 
> Cc: <stable@kernel.org>
> URL: http://tracker.ceph.com/issues/38009
> Cc: Patrick Donnelly <pdonnell@redhat.com>
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  fs/ceph/mds_client.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index 3c9d3f609e7f..51366bd053de 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -4039,6 +4039,12 @@ static void handle_session(struct ceph_mds_session *session,
>  		break;
>  
>  	case CEPH_SESSION_FLUSHMSG:
> +		/* flush cap release */
> +		spin_lock(&session->s_cap_lock);
> +		if (session->s_num_cap_releases)
> +			ceph_flush_cap_releases(mdsc, session);
> +		spin_unlock(&session->s_cap_lock);
> +
>  		send_flushmsg_ack(mdsc, session, seq);
>  		break;
>  

Ouch! Good catch!

Reviewed-by: Jeff Layton <jlayton@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ceph: flush cap release on session flush
  2023-02-07  5:19   ` Xiubo Li
@ 2023-02-07 16:03     ` Ilya Dryomov
  0 siblings, 0 replies; 5+ messages in thread
From: Ilya Dryomov @ 2023-02-07 16:03 UTC (permalink / raw)
  To: Xiubo Li
  Cc: Venky Shankar, ceph-devel, jlayton, mchangir, lhenriques, stable,
	Patrick Donnelly

On Tue, Feb 7, 2023 at 6:19 AM Xiubo Li <xiubli@redhat.com> wrote:
>
>
> On 07/02/2023 13:16, Venky Shankar wrote:
> > On Tue, Feb 7, 2023 at 10:35 AM <xiubli@redhat.com> wrote:
> >> From: Xiubo Li <xiubli@redhat.com>
> >>
> >> MDS expects the completed cap release prior to responding to the
> >> session flush for cache drop.
> >>
> >> Cc: <stable@kernel.org>
> >> URL: http://tracker.ceph.com/issues/38009
> >> Cc: Patrick Donnelly <pdonnell@redhat.com>
> >> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> >> ---
> >>   fs/ceph/mds_client.c | 6 ++++++
> >>   1 file changed, 6 insertions(+)
> >>
> >> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> >> index 3c9d3f609e7f..51366bd053de 100644
> >> --- a/fs/ceph/mds_client.c
> >> +++ b/fs/ceph/mds_client.c
> >> @@ -4039,6 +4039,12 @@ static void handle_session(struct ceph_mds_session *session,
> >>                  break;
> >>
> >>          case CEPH_SESSION_FLUSHMSG:
> >> +               /* flush cap release */
> >> +               spin_lock(&session->s_cap_lock);
> >> +               if (session->s_num_cap_releases)
> >> +                       ceph_flush_cap_releases(mdsc, session);
> >> +               spin_unlock(&session->s_cap_lock);
> >> +
> >>                  send_flushmsg_ack(mdsc, session, seq);
> >>                  break;
> > Ugh. kclient never flushed cap releases o_O
>
> Yeah, I think this was missed before.

Now queued up for 6.2-rc8.

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-07 16:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07  5:04 [PATCH] ceph: flush cap release on session flush xiubli
2023-02-07  5:16 ` Venky Shankar
2023-02-07  5:19   ` Xiubo Li
2023-02-07 16:03     ` Ilya Dryomov
2023-02-07 12:48 ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).