[cephfs] snapshot names are too long

Bug #1967760 reported by Goutham Pacha Ravi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Low
Victoria Martinez de la Cruz

Bug Description

Description
===========
This issue was first reported on the CephFS mailing list: https://<email address hidden>/thread/VREULFBGVN43TN4L3CR6LFXWN3NGJ7K3/
Relevant excerpt from that post:

```````````

The Manila driver creates pretty long subvolume snapshot names:
https://github.com/openstack/manila/blob/master/manila/share/drivers/cephfs
Ex: 3c42f809-4b10-4877-911d-c68910747ae5_eb90c527-9de4-4f57-87bf-6b06f57a396c

And we have trouble accessing those.

It works with a recent kernel this way:

# ls
/cephfs-pam-fuse/volumes/_nogroup/dbebbb35-31f1-47e5-ac75-48d65a1ee33c/.snap/3c42f809-4b10-4877-911d-c68910747ae5_eb90c527-9de4-4f57-87bf-6b06f57a396c/fe1b97f3-3481-43a9-a677-c9424544de09/
now
#

But we cannot see the "now" file when listing via .snap in a subdir:

# ls
/cephfs-pam-fuse/volumes/_nogroup/dbebbb35-31f1-47e5-ac75-48d65a1ee33c/fe1b97f3-3481-43a9-a677-c9424544de09/.snap/_3c42f809-4b10-4877-911d-c68910747ae5_eb90c527-9de4-4f57-87bf-6b06f57a396c_1100/
#

(Subvolume_V2 users always mount the subdir, so they can only ever
access snaps via the subdir path, btw).

The kernel client has the same issue (confirmed with latest CentOS
Stream 8 kernel).

And btw old kernels can't even list this dir. Here is the latest
CentOS 7 kernel:

# ls
/cephfs-pam/volumes/_nogroup/dbebbb35-31f1-47e5-ac75-48d65a1ee33c/fe1b97f3-3481-43a9-a677-c9424544de09/.snap/
ls: cannot access
/cephfs-pam/volumes/_nogroup/dbebbb35-31f1-47e5-ac75-48d65a1ee33c/fe1b97f3-3481-43a9-a677-c9424544de09/.snap/_3c42f809-4b10-4877-911d-c68910747ae5_eb90c527-9de4-4f57-87bf-6b06f57a396c_1100:
No such file or directory
_3c42f809-4b10-4877-911d-c68910747ae5_eb90c527-9de4-4f57-87bf-6b06f57a396c_1100

I think this is all because the snap name is too long.
Notice that the subdir snap has _1100 appended -- this is supposed to
be the inode of the place where the snap was taken (IIUC) -- but it
has been truncated to 80 chars, presumably because of
https://github.com/ceph/ceph/blob/master/src/mds/snap.cc#L87

``````````````

Steps to reproduce
==================

* Setup the CephFS driver (doesn't matter if using Native/NFS)
* Create a share and a snapshot
* Mount the share and navigate to the .snap directory and try walking down the snap tree for the snapshot created.

Expected result
===============
Directory walk is permitted into the read only snapshot directories

Actual result
=============
Directory walk isn't possible due to errors.

Environment
===========
1. Victoria+ releases of OpenStack Manila (manila driver started using the ceph mgr interface in this OpenStack release)

2. Which storage backend did you use?
   Ceph
   What's the version of that? Octopus

Vida Haririan (vhariria)
tags: added: cephfs
Vida Haririan (vhariria)
Changed in manila:
importance: Undecided → Low
assignee: nobody → Victoria Martinez de la Cruz (vkmc)
Vida Haririan (vhariria)
Changed in manila:
milestone: none → zed-2
Revision history for this message
Vida Haririan (vhariria) wrote :
Changed in manila:
milestone: zed-2 → zed-3
Changed in manila:
milestone: zed-3 → zed-rc1
Changed in manila:
milestone: zed-rc1 → antelope-1
Changed in manila:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/manila/+/862348

Changed in manila:
status: Confirmed → In Progress
Changed in manila:
milestone: antelope-1 → antelope-2
Changed in manila:
milestone: antelope-2 → antelope-3
Changed in manila:
milestone: antelope-3 → antelope-rc1
Changed in manila:
milestone: antelope-rc1 → bobcat-1
Changed in manila:
milestone: bobcat-1 → bobcat-2
Changed in manila:
milestone: bobcat-2 → bobcat-3
Changed in manila:
milestone: bobcat-3 → bobcat-rc1
Changed in manila:
milestone: bobcat-rc1 → caracal-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.opendev.org/c/openstack/manila/+/862348
Committed: https://opendev.org/openstack/manila/commit/c86523d5909a2d61e03fb29f4c0c71b67cf18205
Submitter: "Zuul (22348)"
Branch: master

commit c86523d5909a2d61e03fb29f4c0c71b67cf18205
Author: Victoria Martinez de la Cruz <email address hidden>
Date: Mon Sep 19 08:31:13 2022 +0000

    Shorten snapshots names in CephFS drivers

    The name set to snapshots in the CephFS drivers
    is generated appending the snapshot id with the
    snapshot instance id.

    This is a problem because Ceph has a limitation
    in the name of the subvolumes (shares) being created.

    What happens then is, when trying to create a snapshot,
    the snapshot gets created with a truncated name and it cannot
    be accessed later.

    This change drops the snapshot instance id from the
    assigned name in order to avoid this limitation.

    Closes-Bug: #1967760

    Change-Id: Ifab3ec9de2abeb1af8e6499feca0236e1ee22fcf

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/2023.2)

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/manila/+/896321

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/manila/+/896321
Committed: https://opendev.org/openstack/manila/commit/4d4d4bdb118968b1cb089fa8b415c8354874e3a7
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 4d4d4bdb118968b1cb089fa8b415c8354874e3a7
Author: Victoria Martinez de la Cruz <email address hidden>
Date: Mon Sep 19 08:31:13 2022 +0000

    Shorten snapshots names in CephFS drivers

    The name set to snapshots in the CephFS drivers
    is generated appending the snapshot id with the
    snapshot instance id.

    This is a problem because Ceph has a limitation
    in the name of the subvolumes (shares) being created.

    What happens then is, when trying to create a snapshot,
    the snapshot gets created with a truncated name and it cannot
    be accessed later.

    This change drops the snapshot instance id from the
    assigned name in order to avoid this limitation.

    Closes-Bug: #1967760

    Change-Id: Ifab3ec9de2abeb1af8e6499feca0236e1ee22fcf
    (cherry picked from commit c86523d5909a2d61e03fb29f4c0c71b67cf18205)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/2023.1)

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/manila/+/897969

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/zed)

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/manila/+/897970

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 17.1.0

This issue was fixed in the openstack/manila 17.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/manila/+/897969
Committed: https://opendev.org/openstack/manila/commit/3be5df4e1fe5feac43c3c1524eb00c4441eec476
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 3be5df4e1fe5feac43c3c1524eb00c4441eec476
Author: Victoria Martinez de la Cruz <email address hidden>
Date: Mon Sep 19 08:31:13 2022 +0000

    Shorten snapshots names in CephFS drivers

    The name set to snapshots in the CephFS drivers
    is generated appending the snapshot id with the
    snapshot instance id.

    This is a problem because Ceph has a limitation
    in the name of the subvolumes (shares) being created.

    What happens then is, when trying to create a snapshot,
    the snapshot gets created with a truncated name and it cannot
    be accessed later.

    This change drops the snapshot instance id from the
    assigned name in order to avoid this limitation.

    Closes-Bug: #1967760

    Change-Id: Ifab3ec9de2abeb1af8e6499feca0236e1ee22fcf
    (cherry picked from commit c86523d5909a2d61e03fb29f4c0c71b67cf18205)
    (cherry picked from commit 4d4d4bdb118968b1cb089fa8b415c8354874e3a7)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/manila/+/901282

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/manila/+/901283

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/manila/+/901284

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/manila/+/897970
Committed: https://opendev.org/openstack/manila/commit/569a30df0533fe1bd0b53d5111d801353a1dc126
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 569a30df0533fe1bd0b53d5111d801353a1dc126
Author: Victoria Martinez de la Cruz <email address hidden>
Date: Mon Sep 19 08:31:13 2022 +0000

    Shorten snapshots names in CephFS drivers

    The name set to snapshots in the CephFS drivers
    is generated appending the snapshot id with the
    snapshot instance id.

    This is a problem because Ceph has a limitation
    in the name of the subvolumes (shares) being created.

    What happens then is, when trying to create a snapshot,
    the snapshot gets created with a truncated name and it cannot
    be accessed later.

    This change drops the snapshot instance id from the
    assigned name in order to avoid this limitation.

    Closes-Bug: #1967760

    Change-Id: Ifab3ec9de2abeb1af8e6499feca0236e1ee22fcf
    (cherry picked from commit c86523d5909a2d61e03fb29f4c0c71b67cf18205)
    (cherry picked from commit 4d4d4bdb118968b1cb089fa8b415c8354874e3a7)
    (cherry picked from commit 3be5df4e1fe5feac43c3c1524eb00c4441eec476)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/manila/+/901282
Committed: https://opendev.org/openstack/manila/commit/67187c28fae622d679362adf4c68f968ce33473e
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 67187c28fae622d679362adf4c68f968ce33473e
Author: Victoria Martinez de la Cruz <email address hidden>
Date: Mon Sep 19 08:31:13 2022 +0000

    Shorten snapshots names in CephFS drivers

    The name set to snapshots in the CephFS drivers
    is generated appending the snapshot id with the
    snapshot instance id.

    This is a problem because Ceph has a limitation
    in the name of the subvolumes (shares) being created.

    What happens then is, when trying to create a snapshot,
    the snapshot gets created with a truncated name and it cannot
    be accessed later.

    This change drops the snapshot instance id from the
    assigned name in order to avoid this limitation.

    Closes-Bug: #1967760

    Change-Id: Ifab3ec9de2abeb1af8e6499feca0236e1ee22fcf
    (cherry picked from commit c86523d5909a2d61e03fb29f4c0c71b67cf18205)
    (cherry picked from commit 4d4d4bdb118968b1cb089fa8b415c8354874e3a7)
    (cherry picked from commit 3be5df4e1fe5feac43c3c1524eb00c4441eec476)
    (cherry picked from commit 569a30df0533fe1bd0b53d5111d801353a1dc126)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/manila/+/901283
Committed: https://opendev.org/openstack/manila/commit/823e1b416910c41d45551fe345e12f321bae3ca8
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 823e1b416910c41d45551fe345e12f321bae3ca8
Author: Victoria Martinez de la Cruz <email address hidden>
Date: Mon Sep 19 08:31:13 2022 +0000

    Shorten snapshots names in CephFS drivers

    The name set to snapshots in the CephFS drivers
    is generated appending the snapshot id with the
    snapshot instance id.

    This is a problem because Ceph has a limitation
    in the name of the subvolumes (shares) being created.

    What happens then is, when trying to create a snapshot,
    the snapshot gets created with a truncated name and it cannot
    be accessed later.

    This change drops the snapshot instance id from the
    assigned name in order to avoid this limitation.

    Closes-Bug: #1967760

    Change-Id: Ifab3ec9de2abeb1af8e6499feca0236e1ee22fcf
    (cherry picked from commit c86523d5909a2d61e03fb29f4c0c71b67cf18205)
    (cherry picked from commit 4d4d4bdb118968b1cb089fa8b415c8354874e3a7)
    (cherry picked from commit 3be5df4e1fe5feac43c3c1524eb00c4441eec476)
    (cherry picked from commit 569a30df0533fe1bd0b53d5111d801353a1dc126)
    (cherry picked from commit 67187c28fae622d679362adf4c68f968ce33473e)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 16.2.0

This issue was fixed in the openstack/manila 16.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 15.4.0

This issue was fixed in the openstack/manila 15.4.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 14.2.0

This issue was fixed in the openstack/manila 14.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila xena-eom

This issue was fixed in the openstack/manila xena-eom release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on manila (stable/wallaby)

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/manila/+/901284
Reason: stable/wallaby branch of openstack/manila is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/wallaby if you want to further work on this patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (unmaintained/wallaby)

Fix proposed to branch: unmaintained/wallaby
Review: https://review.opendev.org/c/openstack/manila/+/911619

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 18.0.0.0rc1

This issue was fixed in the openstack/manila 18.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.