Re: RBD image name constraints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux