Skip to content

lvresize of CoW snapshot incorrectly applies filesystem resize checks #163

@bmr-cymru

Description

@bmr-cymru

Resizing a CoW snapshot LV with lvresize allows the snapshot exception store to be extended. Attempting to shrink a CoW snapshot with a file system present incorrectly applies the filesystem resize checks as though the device size was being modified rather than the exception store:

# lvcreate -n test1 -L 1G fedora
  Logical volume "test1" created.

# mkfs.xfs /dev/fedora/test1
Or:
# mkfs.ext4 /dev/fedora/test1

# lvcreate -s -n test1-snap -L 1G fedora/test1
  Logical volume "test1-snap" created.

Attempting to shrink the CoW exception store fails with:

XFS:
# lvresize -L512M fedora/test1-snap
  File system xfs found on fedora/test1-snap.
  File system size (1.00 GiB) is larger than the requested size (512.00 MiB).
  File system reduce is required and not supported (xfs).

Ext4:
# lvresize -L512M fedora/test1-snap
  File system ext4 found on fedora/test1-snap.
  File system size (1.00 GiB) is larger than the requested size (512.00 MiB).
  File system reduce is required (see resize2fs or --resizefs.)

The check that should be applied would determine whether it's safe to truncate the CoW store (i.e. fail if any exceptions are allocated beyond the new size limit).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions