Fix handling of paths with multuple mounts — for example rootfs first mount for /

This commit is contained in:
Michael Raskin 2014-09-03 10:11:18 +04:00
parent 9f37c14974
commit 74343ca3ab
2 changed files with 15 additions and 0 deletions

View File

@ -16,6 +16,8 @@ stdenv.mkDerivation rec {
asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt
];
patches = [ ./multiple_mounts.patch ];
# for btrfs to get the rpath to libgcc_s, needed for pthread_cancel to work
NIX_CFLAGS_LINK = "-lgcc_s";

View File

@ -0,0 +1,13 @@
Only in btrfs-progs-v3.16-orig: btrfs-progs-v3.16
diff -U3 -r btrfs-progs-v3.16-orig/utils.c btrfs-progs-v3.16/utils.c
--- btrfs-progs-v3.16-orig/utils.c 2014-09-03 09:57:45.644858545 +0400
+++ btrfs-progs-v3.16/utils.c 2014-09-03 09:59:26.968855663 +0400
@@ -2360,7 +2360,7 @@
len = strlen(ent->mnt_dir);
if (strncmp(ent->mnt_dir, path, len) == 0) {
/* match found */
- if (longest_matchlen < len) {
+ if ((longest_matchlen < len) || (longest_matchlen==len && not_btrfs)) {
free(longest_match);
longest_matchlen = len;
longest_match = strdup(ent->mnt_dir);