Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btrfs-progs: receive: cannot find clone source subvol when receiving in reverse direction #643

Closed
wants to merge 1 commit into from
Closed

Conversation

ettavolt
Copy link
Contributor

process_clone, unlike process_snapshot, only searched a subvolume matching by received uuid. However, when earlier "receiver" side sends, it mentions received uuid, which is for earlier "send" side (now "receiver" side) is just uuid.

Fixes #606.

@ettavolt
Copy link
Contributor Author

New test before the change: test-fail.log
and after: test-pass.log.

Note, I've collected these with btrfs -v receive, which is not set in what I've pushed.

@ettavolt
Copy link
Contributor Author

Looks like ubuntu-latest is 22.04, not even 23.04, or dd would have known oseek.

I've changed the test to old parameter name.

@ettavolt
Copy link
Contributor Author

Why did it decide to fail in 028-superblock-recover now, but not during previous run? :-O

@kdave
Copy link
Owner

kdave commented Nov 14, 2023

The test 028 randomly fails in the github CI, I don't know why, you don't have to worry about it.

@kdave
Copy link
Owner

kdave commented Nov 14, 2023

Looks like ubuntu-latest is 22.04, not even 23.04, or dd would have known oseek.

Yeah the CI images are old (kernel and user space), so the tests have to test for new features or not use new functionality.

@joanbm
Copy link

joanbm commented Nov 20, 2023

The first parameter of search_source_subvol should be changed from a struct subvol_uuid_search * to an int, which I suggest naming mnt_fd, otherwise this generates some integer <->pointer conversion warnings.

(Note that there are two different declarations of subvol_uuid_search in btrfs-progs, which probably caused the confusion with the typings).

(Also posted to LKML before I saw that there was also an open PR, sorry for the spam)

@ettavolt
Copy link
Contributor Author

Thanks, joanbm. To me that looked like a copy-paste error. ☺

@ettavolt
Copy link
Contributor Author

Sorry, kdave, do I need to do something else to have this merged?

@ettavolt
Copy link
Contributor Author

Hi @kdave, sorry for the noise, but can this be merged please? Is there anything I can do to improve the patch?

when receiving in reverse direction

process_clone only searches the received_uuid, but could exist in an earlier
uuid that isn't the received_uuid.  Mirror what process_snapshot does and search
both the received_uuid and if that fails look up by normal uuid.

Fixes: #606

Signed-off-by: Arsenii Skvortsov <ettavolt@gmail.com>
@kdave kdave added this to the v6.8.1 milestone Apr 29, 2024
@kdave
Copy link
Owner

kdave commented Apr 29, 2024

Sorry, I keep forgetting about this PR. Marked for 6.8.1 or 6.9 at the latest.

@kdave kdave modified the milestones: v6.8.1, v6.8.2 May 2, 2024
kdave pushed a commit that referenced this pull request May 17, 2024
…in reverse direction

process_clone() only searches the received_uuid, but could exist in an
earlier uuid that isn't the received_uuid.  Mirror what process_snapshot
does and search both the received_uuid and if that fails look up by
normal uuid.

Fixes: #606

Issue: #606
Pull-request: #643
Signed-off-by: Arsenii Skvortsov <ettavolt@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
@kdave kdave modified the milestones: v6.8.2, v6.9 May 17, 2024
@kdave
Copy link
Owner

kdave commented May 17, 2024

Now added to devel, thanks. As said in #606 I don't remember if there was a reason to do it as before, some use cases were not meant to be possible and some of them were with reverse receive. I hope nothing else breaks (we had such cases unfortunatelly).

@kdave kdave closed this May 17, 2024
@kdave
Copy link
Owner

kdave commented May 17, 2024

Minor changes to the test case: indentation and parameter quoting.

kdave pushed a commit that referenced this pull request Aug 7, 2024
…in reverse direction

process_clone() only searches the received_uuid, but could exist in an
earlier uuid that isn't the received_uuid.  Mirror what process_snapshot
does and search both the received_uuid and if that fails look up by
normal uuid.

Fixes: #606

Issue: #606
Pull-request: #643
Pull-request: #862
Signed-off-by: Arsenii Skvortsov <ettavolt@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
kdave pushed a commit that referenced this pull request Aug 9, 2024
…in reverse direction

process_clone() only searches the received_uuid, but could exist in an
earlier uuid that isn't the received_uuid.  Mirror what process_snapshot
does and search both the received_uuid and if that fails look up by
normal uuid.

Fixes: #606

Issue: #606
Pull-request: #643
Pull-request: #862
Signed-off-by: Arsenii Skvortsov <ettavolt@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
kdave pushed a commit that referenced this pull request Aug 14, 2024
…in reverse direction

process_clone() only searches the received_uuid, but could exist in an
earlier uuid that isn't the received_uuid.  Mirror what process_snapshot
does and search both the received_uuid and if that fails look up by
normal uuid.

Fixes: #606

Issue: #606
Pull-request: #643
Pull-request: #862
Signed-off-by: Arsenii Skvortsov <ettavolt@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
kdave pushed a commit that referenced this pull request Aug 14, 2024
…in reverse direction

process_clone() only searches the received_uuid, but could exist in an
earlier uuid that isn't the received_uuid.  Mirror what process_snapshot
does and search both the received_uuid and if that fails look up by
normal uuid.

Fixes: #606

Issue: #606
Pull-request: #643
Pull-request: #862
Signed-off-by: Arsenii Skvortsov <ettavolt@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
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.

btrfs receive occasionally fails to find parent subvolume when data flows in the reverse direction
3 participants