ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiubo Li <xiubli@redhat.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: idryomov@gmail.com, pdonnell@redhat.com, ceph-devel@vger.kernel.org
Subject: Re: [PATCH 2/3] ceph: don't WARN if we're force umounting
Date: Tue, 24 Aug 2021 09:07:07 +0800	[thread overview]
Message-ID: <f6950e48-62cd-9dc0-0bd4-f7a492ca4311@redhat.com> (raw)
In-Reply-To: <7bf49c80528b31f6350d7f3ee2a5a69da42aaa69.camel@kernel.org>


On 8/23/21 9:49 PM, Jeff Layton wrote:
> On Wed, 2021-08-18 at 16:06 +0800, xiubli@redhat.com wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> Force umount will try to close the sessions by setting the session
>> state to _CLOSING, so in ceph_kill_sb after that it will warn on it.
>>
>> URL: https://tracker.ceph.com/issues/52295
>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
>> ---
>>   fs/ceph/mds_client.c | 9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
>> index a632e1c7cef2..0302af53e079 100644
>> --- a/fs/ceph/mds_client.c
>> +++ b/fs/ceph/mds_client.c
>> @@ -4558,6 +4558,8 @@ static void maybe_recover_session(struct ceph_mds_client *mdsc)
>>   
>>   bool check_session_state(struct ceph_mds_session *s)
>>   {
>> +	struct ceph_fs_client *fsc = s->s_mdsc->fsc;
>> +
>>   	switch (s->s_state) {
>>   	case CEPH_MDS_SESSION_OPEN:
>>   		if (s->s_ttl && time_after(jiffies, s->s_ttl)) {
>> @@ -4566,8 +4568,11 @@ bool check_session_state(struct ceph_mds_session *s)
>>   		}
>>   		break;
>>   	case CEPH_MDS_SESSION_CLOSING:
>> -		/* Should never reach this when we're unmounting */
>> -		WARN_ON_ONCE(s->s_ttl);
>> +		/*
>> +		 * Should never reach this when none force unmounting
>> +		 */
>> +		if (READ_ONCE(fsc->mount_state) != CEPH_MOUNT_SHUTDOWN)
>> +			WARN_ON_ONCE(s->s_ttl);
> How about something like this instead?
>
>      WARN_ON_ONCE(s->s_ttl && READ_ONCE(fsc->mount_state) != CEPH_MOUNT_SHUTDOWN);


This looks good to me too. Will fix it.

Thanks


>
>>   		fallthrough;
>>   	case CEPH_MDS_SESSION_NEW:
>>   	case CEPH_MDS_SESSION_RESTARTING:


  reply	other threads:[~2021-08-24  1:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18  8:06 [PATCH 0/3] ceph: remove the capsnaps when removing the caps xiubli
2021-08-18  8:06 ` [PATCH 1/3] " xiubli
2021-08-23 13:47   ` Jeff Layton
2021-08-24  1:04     ` Xiubo Li
2021-08-23 14:58   ` Jeff Layton
2021-08-24  1:05     ` Xiubo Li
2021-08-18  8:06 ` [PATCH 2/3] ceph: don't WARN if we're force umounting xiubli
2021-08-23 13:49   ` Jeff Layton
2021-08-24  1:07     ` Xiubo Li [this message]
2021-08-18  8:06 ` [PATCH 3/3] ceph: don't WARN if we're iterate removing the session caps xiubli
2021-08-23 13:59   ` Jeff Layton
2021-08-24  1:43     ` Xiubo Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6950e48-62cd-9dc0-0bd4-f7a492ca4311@redhat.com \
    --to=xiubli@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=pdonnell@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).