Two xfs file systems with same UUID can not be mounted on the same sy…#6650
Two xfs file systems with same UUID can not be mounted on the same sy…#6650estesp merged 1 commit intocontainerd:mainfrom
Conversation
|
Hi @henry118. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
kzys
left a comment
There was a problem hiding this comment.
The change looks good to me.
Is it possible to reproduce the issue by expanding https://github.com/containerd/containerd/blob/main/snapshots/devmapper/snapshotter_test.go? Does GitHub Actions have mkfs.xfs?
|
Build succeeded.
|
|
The errors happens after |
|
If we make two snapshots with xfs and mount both of them, would it reproduce the error? A lot of containerd tests actually run syscalls such as mount. |
|
Can you point me some sample unit tests as you mentioned? so I can use them as references for implementing the new test cases... Thanks! |
|
How about this one? I believe that mount here is not mocked. containerd/snapshots/devmapper/snapshotter_test.go Lines 126 to 130 in b521429 |
|
Great thanks, will look into it. |
|
|
||
| ctx := context.Background() | ||
| ctx = namespaces.WithNamespace(ctx, "testsuite") | ||
| tempDir, err := os.MkdirTemp("", "snapshot-suite-usage") |
There was a problem hiding this comment.
this logic was taken from https://github.com/containerd/containerd/blob/main/snapshots/devmapper/snapshotter_test.go#L89
I think it was chosen because we want to explicitly specify a pattern for the temp directory?
There was a problem hiding this comment.
I believe, we simply didn't have t.TempDir when we first wrote that code. It is added in Go 1.15.
There was a problem hiding this comment.
Probably. However i still believe the original logic works better. For instance we can easily locate the path when we have to debug a failing test case with an explicitly specified dir pattern. I actually found it useful when I wrote this unit test. But if you have a strong opinion about this I am fine with making the change.
| var ( | ||
| sizeBytes int64 = 1048576 // 1MB | ||
| baseApplier = fstest.Apply(fstest.CreateRandomFile("/a", 12345679, sizeBytes, 0777)) | ||
| ) |
There was a problem hiding this comment.
Why? baseApplier is needed to create a snapshot.
There was a problem hiding this comment.
I think (not 100% sure, sorry) that Prepare() returns a XFS-formatted devmapper device. So mounting two of them is enough to reproduce the original issue. Would it work?
There was a problem hiding this comment.
Nope. we have to prepare an additional snapshot from a base one.
| err := dmsetup.CreatePool(config.PoolName, loopDataDevice, loopMetaDevice, 64*1024/dmsetup.SectorSize) | ||
| assert.NilError(t, err, "failed to create pool %q", config.PoolName) | ||
|
|
||
| snap, err := NewSnapshotter(context.Background(), config) |
There was a problem hiding this comment.
How about taking the passed ctx instead of making a new one?
Two xfs file systems with same UUID can not be mounted on the same system. However devmapper snapshots will have same UUID as original filesystem. This patch fixes the bug by mounting a xfs file system with "nouuid" option. Signed-off-by: Henry Wang <[email protected]>
|
Build succeeded.
|
|
/ok-to-test |
|
recheck |
1 similar comment
|
recheck |
|
Build succeeded.
|
|
@fffrog |
Fixes issue: #6587
Two xfs file systems with same UUID can not be mounted on the same system. However devmapper snapshots will have same UUID as original filesystem.
This patch fixes the bug by mounting a xfs file system with "nouuid" option.
Signed-off-by: Henry Wang [email protected]