Revert "Btrfs-progs: fix mount point detection due to partial prefix match"

This reverts commit cb8abddb20.

There are several reports in IRC that this patch breaks in some
send/receive environments. There are no exact steps to reproduce, only
approximate descroptions. Until a proper reproducer is known, the patch
is temporarily reverted due to the user-visible impact.

Issue: #162
Signed-off-by: David Sterba <dsterba@suse.com>
master
David Sterba 2019-02-25 18:08:29 +01:00
parent 2e84a13a10
commit f9148e3841
1 changed files with 1 additions and 2 deletions

View File

@ -2078,8 +2078,7 @@ int find_mount_root(const char *path, char **mount_root)
while ((ent = getmntent(mnttab))) {
len = strlen(ent->mnt_dir);
if (strncmp(ent->mnt_dir, path, len) == 0 &&
(path[len] == '/' || path[len] == '\0')) {
if (strncmp(ent->mnt_dir, path, len) == 0) {
/* match found and use the latest match */
if (longest_matchlen <= len) {
free(longest_match);