On Fri, Nov 27, 2015 at 06:15:41PM +0100, Stanislav Brabec wrote: > root has to be literally the same as src_root, which is already the path > prefixed by /{subvolume}. Otherwise it will not match in > mnt_fs_streq_target(fs, xtgt) inside mnt_table_is_fs_mounted() and > repeated "mount -a" will mount it again and again. yes > if (src_root && !startswith(root, src_root)) { > - size_t sz = strlen(root) + strlen(src_root) + 1; > - char *tmp = malloc(sz); > - > + char *tmp = strdup (src_root); > if (!tmp) > goto err; > - snprintf(tmp, sz, "%s%s", src_root, root); > free(root); > root = tmp; > } but this code is there for another use case. The problem is when the fstab_fs source is *sub-directory* on btrfs subvolume (or another bind mount). For example imagine: /dev/sdc /mnt/test btrfs subvol=/anydir /mnt/test/foo /mnt/test2 auto bind then FS root for /mnt/test2 is /anydir/foo on /dev/sdc. The problem is that the code does not recognize your use-case with "/" (no sub-directory on source FS). My bugfix: https://github.com/karelzak/util-linux/commit/352740e88e2c9cb180fe845ce210b1c7b5ad88c7 try it :-) Anyway, we need more regression tests for these crazy use-cases. Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html