Skip to content

snapshots/devmapper: suspend a device to avoid data corruption#4374

Merged
fuweid merged 1 commit intocontainerd:masterfrom
kzys:suspend-devmapper
Jul 22, 2020
Merged

snapshots/devmapper: suspend a device to avoid data corruption#4374
fuweid merged 1 commit intocontainerd:masterfrom
kzys:suspend-devmapper

Conversation

@kzys
Copy link
Copy Markdown
Member

@kzys kzys commented Jul 14, 2020

Hello containerd folks,

We have found this issue in our testing stack and the fix seems working so far. I still haven't reproduced the issue locally with containerd-stress though.


According to https://github.com/torvalds/linux/blob/c309b6f24222246c18a8b65d3950e6e755440865/Documentation/admin-guide/device-mapper/thin-provisioning.rst#internal-snapshots;

If the origin device that you wish to snapshot is active, you
must suspend it before creating the snapshot to avoid corruption.

However the devmapper snapshotter is currently not doing that.

Signed-off-by: Kazuyoshi Kato [email protected]

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 14, 2020

Build succeeded.

Copy link
Copy Markdown
Member

@mxpv mxpv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally the fix makes sense to me.
I have one minor doc related comment below.

LGTM once the CI is green.

Comment thread snapshots/devmapper/pool_device.go Outdated
@kzys
Copy link
Copy Markdown
Member Author

kzys commented Jul 15, 2020

Let me rebase this branch first. I think master was not passing CI checks before.

@kzys kzys force-pushed the suspend-devmapper branch from 8d183b5 to d6262a3 Compare July 15, 2020 20:55
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 15, 2020

Build succeeded.

@mxpv
Copy link
Copy Markdown
Member

mxpv commented Jul 16, 2020

@kzys can you please do comments in the code and update error messages.

According to https://github.com/torvalds/linux/blob/v5.7/Documentation/admin-guide/device-mapper/thin-provisioning.rst#internal-snapshots;

> If the origin device that you wish to snapshot is active, you
> must suspend it before creating the snapshot to avoid corruption.

However the devmapper snapshotter was not doing that.

Signed-off-by: Kazuyoshi Kato <[email protected]>
@kzys kzys force-pushed the suspend-devmapper branch from d6262a3 to c383436 Compare July 16, 2020 22:09
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 16, 2020

Build succeeded.

@kzys
Copy link
Copy Markdown
Member Author

kzys commented Jul 16, 2020

Would you mind if I backport the change to 1.3.x? I need to add ResumeDevice in addition to though.

kzys@c2cf057

@mxpv
Copy link
Copy Markdown
Member

mxpv commented Jul 16, 2020

Would you mind if I backport the change to 1.3.x? I need to add ResumeDevice in addition to though.

sure

@mxpv
Copy link
Copy Markdown
Member

mxpv commented Jul 16, 2020

LGTM


// The base device must be suspend before taking a snapshot to
// avoid corruption.
// https://github.com/torvalds/linux/blob/v5.7/Documentation/admin-guide/device-mapper/thin-provisioning.rst#internal-snapshots
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it only work for new kernel?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I just picked the latest non-rc version, because pointing master might break in future.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can use 5.4 (the latest LTS). 4.19 (the previous LTS) doesn't work well since the URL is different.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late reply. Merged

Copy link
Copy Markdown
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants