linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yanhu Cao <gmayyyha@gmail.com>
To: Ilya Dryomov <idryomov@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>, Sage Weil <sage@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	kuba@kernel.org, Ceph Development <ceph-devel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] ceph: using POOL FULL flag instead of OSDMAP FULL flag
Date: Mon, 2 Mar 2020 10:30:42 +0800	[thread overview]
Message-ID: <CAB9OAC08TGgXGFJsZCNpMzqnorn=jw1S_i8Ux2euaG=4-=JGwg@mail.gmail.com> (raw)
In-Reply-To: <CAOi1vP_opdc=OP70T2eiamMWa-o71nU8t_LYyTCytqT5BT8gdQ@mail.gmail.com>

On Fri, Feb 28, 2020 at 10:02 PM Ilya Dryomov <idryomov@gmail.com> wrote:
>
> On Fri, Feb 28, 2020 at 12:41 PM Yanhu Cao <gmayyyha@gmail.com> wrote:
> >
> > On Fri, Feb 28, 2020 at 6:23 PM Ilya Dryomov <idryomov@gmail.com> wrote:
> > >
> > > On Fri, Feb 28, 2020 at 5:45 AM Yanhu Cao <gmayyyha@gmail.com> wrote:
> > > >
> > > > OSDMAP_FULL and OSDMAP_NEARFULL are deprecated since mimic.
> > > >
> > > > Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
> > > > ---
> > > >  fs/ceph/file.c                  |  6 ++++--
> > > >  include/linux/ceph/osd_client.h |  2 ++
> > > >  include/linux/ceph/osdmap.h     |  3 ++-
> > > >  net/ceph/osd_client.c           | 23 +++++++++++++----------
> > > >  4 files changed, 21 insertions(+), 13 deletions(-)
> > > >
> > > > diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> > > > index 7e0190b1f821..60ea1eed1b84 100644
> > > > --- a/fs/ceph/file.c
> > > > +++ b/fs/ceph/file.c
> > > > @@ -1482,7 +1482,8 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
> > > >         }
> > > >
> > > >         /* FIXME: not complete since it doesn't account for being at quota */
> > > > -       if (ceph_osdmap_flag(&fsc->client->osdc, CEPH_OSDMAP_FULL)) {
> > > > +       if (pool_flag(&fsc->client->osdc, ci->i_layout.pool_id,
> > > > +                               CEPH_POOL_FLAG_FULL)) {
> > > >                 err = -ENOSPC;
> > > >                 goto out;
> > > >         }
> > > > @@ -1575,7 +1576,8 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
> > > >         }
> > > >
> > > >         if (written >= 0) {
> > > > -               if (ceph_osdmap_flag(&fsc->client->osdc, CEPH_OSDMAP_NEARFULL))
> > > > +               if (pool_flag(&fsc->client->osdc, ci->i_layout.pool_id,
> > > > +                                       CEPH_POOL_FLAG_NEARFULL))
> > >
> > > Hi Yanhu,
> > >
> > > Have you considered pre-mimic clusters here?  They are still supported
> > > (and will continue to be supported for the foreseeable future).
> > >
> > > Thanks,
> > >
> > >                 Ilya
> >
> > I have tested it work on Luminous, I think it work too since
> > ceph-v0.80(https://github.com/ceph/ceph/blob/b78644e7dee100e48dfeca32c9270a6b210d3003/src/osd/osd_types.h#L815)
> > alread have pool FLAG_FULL.
>
> But not FLAG_NEARFULL, which appeared in mimic.
FLAG_NEARFULL appeared in Luminous.

>
> >
> > CephFS doesn't write synchronously even if CEPH_OSDMAP_NEARFULL is
> > used, then should fixed by CEPH_POOL_FLAG_NEARFULL.
>
> I'm not sure I follow.
>
> -    if (ceph_osdmap_flag(&fsc->client->osdc, CEPH_OSDMAP_NEARFULL))
> +    if (pool_flag(&fsc->client->osdc, ci->i_layout.pool_id,
> +                            CEPH_POOL_FLAG_NEARFULL))
>
> AFAICT this change would effectively disable this branch for pre-mimic
> clusters.  Are you saying this branch is already broken?
>
> Thanks,
>
>                 Ilya
CEPH_OSDMAP_NEARFULL is not set in Jewel, so it has no effect. And in
Luminous version, this flag is cleared as a legacy and has no effect
too.

  reply	other threads:[~2020-03-02  2:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28  4:45 [PATCH] ceph: using POOL FULL flag instead of OSDMAP FULL flag Yanhu Cao
2020-02-28 10:23 ` Ilya Dryomov
2020-02-28 11:41   ` Yanhu Cao
2020-02-28 14:01     ` Ilya Dryomov
2020-03-02  2:30       ` Yanhu Cao [this message]
2020-03-02 10:08         ` Ilya Dryomov
2020-03-02 11:01           ` Yanhu Cao
2020-03-02 14:31             ` Ilya Dryomov

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='CAB9OAC08TGgXGFJsZCNpMzqnorn=jw1S_i8Ux2euaG=4-=JGwg@mail.gmail.com' \
    --to=gmayyyha@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sage@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).