CEPH filesystem development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: "Yan, Zheng" <ukernel@gmail.com>
Cc: ceph-devel <ceph-devel@vger.kernel.org>,
	Ilya Dryomov <idryomov@gmail.com>,
	Patrick Donnelly <pdonnell@redhat.com>
Subject: Re: [RFC PATCH 2/4] ceph: don't mark mount as SHUTDOWN when recovering session
Date: Tue, 29 Sep 2020 08:30:22 -0400	[thread overview]
Message-ID: <2246f010fe5a697f0694fe769fd1fe131b46ba35.camel@kernel.org> (raw)
In-Reply-To: <CAAM7YAm834Kbf1YYcNa0XGR7EYMnAH4eYs0uBbCr3KNaHccCcQ@mail.gmail.com>

On Tue, 2020-09-29 at 16:20 +0800, Yan, Zheng wrote:
> On Fri, Sep 25, 2020 at 10:08 PM Jeff Layton <jlayton@kernel.org> wrote:
> > When recovering a session (a'la recover_session=clean), we want to do
> > all of the operations that we do on a forced umount, but changing the
> > mount state to SHUTDOWN is wrong and can cause queued MDS requests to
> > fail when the session comes back.
> > 
> 
> code that cleanup page cache check the SHUTDOWN state.
> 

Ok, so we do need to do something else there if we don't mark the thing
SHUTDOWN. Maybe we ought to declare a new mount_state for
this...CEPH_MOUNT_RECOVERING ?

> > Only mark it as SHUTDOWN when umount_begin is called.
> > 
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> >  fs/ceph/super.c | 13 +++++++++----
> >  1 file changed, 9 insertions(+), 4 deletions(-)
> > 
> > diff --git a/fs/ceph/super.c b/fs/ceph/super.c
> > index 2516304379d3..46a0e4e1b177 100644
> > --- a/fs/ceph/super.c
> > +++ b/fs/ceph/super.c
> > @@ -832,6 +832,13 @@ static void destroy_caches(void)
> >         ceph_fscache_unregister();
> >  }
> > 
> > +static void __ceph_umount_begin(struct ceph_fs_client *fsc)
> > +{
> > +       ceph_osdc_abort_requests(&fsc->client->osdc, -EIO);
> > +       ceph_mdsc_force_umount(fsc->mdsc);
> > +       fsc->filp_gen++; // invalidate open files
> > +}
> > +
> >  /*
> >   * ceph_umount_begin - initiate forced umount.  Tear down the
> >   * mount, skipping steps that may hang while waiting for server(s).
> > @@ -844,9 +851,7 @@ static void ceph_umount_begin(struct super_block *sb)
> >         if (!fsc)
> >                 return;
> >         fsc->mount_state = CEPH_MOUNT_SHUTDOWN;
> > -       ceph_osdc_abort_requests(&fsc->client->osdc, -EIO);
> > -       ceph_mdsc_force_umount(fsc->mdsc);
> > -       fsc->filp_gen++; // invalidate open files
> > +       __ceph_umount_begin(fsc);
> >  }
> > 
> >  static const struct super_operations ceph_super_ops = {
> > @@ -1235,7 +1240,7 @@ int ceph_force_reconnect(struct super_block *sb)
> >         struct ceph_fs_client *fsc = ceph_sb_to_client(sb);
> >         int err = 0;
> > 
> > -       ceph_umount_begin(sb);
> > +       __ceph_umount_begin(fsc);
> > 
> >         /* Make sure all page caches get invalidated.
> >          * see remove_session_caps_cb() */
> > --
> > 2.26.2
> > 

-- 
Jeff Layton <jlayton@kernel.org>


  reply	other threads:[~2020-09-29 12:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 14:08 [RFC PATCH 0/4] ceph: fix spurious recover_session=clean errors Jeff Layton
2020-09-25 14:08 ` [RFC PATCH 1/4] ceph: don't WARN when removing caps due to blocklisting Jeff Layton
2020-09-25 14:08 ` [RFC PATCH 2/4] ceph: don't mark mount as SHUTDOWN when recovering session Jeff Layton
2020-09-29  8:20   ` Yan, Zheng
2020-09-29 12:30     ` Jeff Layton [this message]
2020-09-25 14:08 ` [RFC PATCH 3/4] ceph: remove timeout on allowing reconnect after blocklisting Jeff Layton
2020-09-25 14:08 ` [RFC PATCH 4/4] ceph: queue request when CLEANRECOVER is set Jeff Layton
2020-09-29  8:31   ` Yan, Zheng
2020-09-29 12:46     ` Jeff Layton
2020-09-29 19:55   ` Jeff Layton
2020-09-29  8:28 ` [RFC PATCH 0/4] ceph: fix spurious recover_session=clean errors Yan, Zheng
2020-09-29  8:54   ` Ilya Dryomov
2020-09-29 10:44     ` Yan, Zheng
2020-09-29 10:58       ` Ilya Dryomov
2020-09-29 12:48         ` Jeff Layton
2020-09-29 19:50       ` Jeff Layton
2020-09-30  8:45         ` Yan, Zheng
2020-09-30 17:55           ` Jeff Layton
2020-09-30 12:10 ` [RFC PATCH v2 " Jeff Layton
2020-09-30 12:10   ` [RFC PATCH v2 1/4] ceph: don't WARN when removing caps due to blocklisting Jeff Layton
2020-09-30 12:10   ` [RFC PATCH v2 2/4] ceph: don't mark mount as SHUTDOWN when recovering session Jeff Layton
2020-09-30 12:10   ` [RFC PATCH v2 3/4] ceph: remove timeout on allowing reconnect after blocklisting Jeff Layton
2020-09-30 12:10   ` [RFC PATCH v2 4/4] ceph: queue MDS requests to REJECTED sessions when CLEANRECOVER is set Jeff Layton

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=2246f010fe5a697f0694fe769fd1fe131b46ba35.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=pdonnell@redhat.com \
    --cc=ukernel@gmail.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