CEPH filesystem development
 help / color / mirror / Atom feed
From: Mykola Golub <mgolub@mirantis.com>
To: "Bartłomiej Święcki" <bartlomiej.swiecki@corp.ovh.com>
Cc: Ceph Development <ceph-devel@vger.kernel.org>,
	Jason Dillaman <jdillama@redhat.com>,
	Josh Durgin <jdurgin@redhat.com>
Subject: Re: RBD image name constraints
Date: Mon, 11 Apr 2016 12:37:05 +0300	[thread overview]
Message-ID: <20160411093703.GA17959@gmail.com> (raw)
In-Reply-To: <570B6436.9040109@corp.ovh.com>

On Mon, Apr 11, 2016 at 10:45:42AM +0200, Bartłomiej Święcki wrote:
> 
> On 04/08/2016 10:29 PM, Mykola Golub wrote:
> >On Fri, Apr 08, 2016 at 02:23:32PM +0200, Bartłomiej Święcki wrote:
> >
> >>In newer versions there's regex that's parsing image name passed to rbd
> >>command (in src/tools/rbd/Utils.cc, function: extract_spec):
> >>
> >>      "^(?:([^/@]+)/)?([^/@]+)(?:@([^/@]+))?$"
> >>
> >>It won't parse pool name with '@', image name with '/' nor snapshot name
> >>with '/', which was allowed in previous implementation based on strchr.
> >And I would leave this limitation (if there were no real complains
> >from users) because it could be really difficult to understand what a
> >spec that had e.g. two "@" meant.
> Wouldn't that cause backward compatibility issues? I.e. if I've created
> image name with '/' inside, I won't be able to do anything with it after
> upgrading to Jewel, even remove or rename it.
> 
> >
> >You can still bypass the limitation by using --pool, --image, and
> >--snap options, and I would recommend to always use these in scripts
> >instead of specs.
> >
> True, but even if I specify image name with --image argument it still goes
> through rbd::utils::extract_spec function (or set_pool_image_name in old
> code) so there's no way to put there any raw name I want.

Ah, it is rather unfortunate!

I expected that with --image argument you could only specify image
name, but now I see we even have a comment in the code:

    // despite the separate pool and snapshot name options,
    // we can also specify them via the image option

I would prefer if it was possible to specify only image name with
--image argument, but I guess it would cause backward compatibility
issues, so, the simplest solution may be to ease the regexp to:

  "^(?:([^/@]+)/)?([^@]+)(?:@([^@]+))?$" ?

Or may be even:

  "^(?:([^/@]+)/)?([^@]+)(?:@(.+))?$" ?

-- 
Mykola Golub
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-04-11  9:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08 12:23 RBD image name constraints Bartłomiej Święcki
2016-04-08 16:13 ` Ilya Dryomov
2016-04-08 17:36   ` Alex Elder
2016-04-08 18:12     ` Ilya Dryomov
2016-04-11  8:45   ` Bartłomiej Święcki
2016-04-08 20:29 ` Mykola Golub
2016-04-11  8:45   ` Bartłomiej Święcki
2016-04-11  9:37     ` Mykola Golub [this message]
2016-04-11 14:29       ` Jason Dillaman
2016-04-11 15:08         ` Ilya Dryomov
2016-04-12 12:32           ` Bartłomiej Święcki
2016-04-12 12:47             ` Wido den Hollander
2016-04-12 13:01               ` Jason Dillaman
2016-04-12 13:23                 ` 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=20160411093703.GA17959@gmail.com \
    --to=mgolub@mirantis.com \
    --cc=bartlomiej.swiecki@corp.ovh.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=jdillama@redhat.com \
    --cc=jdurgin@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