NixOS/nixpkgs — pull request #3867 by wkennington (2014-08-29 21:54:25+00:00)
Title: nixos/generate-config: Btrfs mounts aren't bind mounts

Currently, we detect any mount points which use the same device but
exist inside of other mount points as bind mounts. This works for
filesystems which are only ever mounted from a device a single time.
However, btrfs contains subvolumes, which are separate filesystem
entities within the same device. These subvolumes are potentially
mounted inside of other mounts for the same btrfs device. Therefore, the
generate config script detects these as bind mounts and breaks the
mountpoint.

Since btrfs is designed to handle many mountpoints for the same device,
it also internally allows you to mount the same device many times. It
even allows you to mount a subvolume or root volume multiple times
within the same filesystem tree. Therefore, it is okay to treat a bind
mount as a regular btrfs mount as it will achieve the same effect.

This patch changes the behavior to simply generate normal entries for
all btrfs mounts, regardless of whether they are bind mounts or not.