On Thu, Jan 28, 2016 at 03:22:07PM +0100, Stanislav Brabec wrote: > Stanislav Brabec wrote: > >Known problems not covered by this patch: > > > >- Use of subvolid= in fstab is not yet handled. > > Patch already created, see mails: > [PATCH 1/2] libmount: run btrfs subvol checks for "subvolid" option > [PATCH 2/2] libmount: code re-indentation I did some changes to the code: * use mnt_resolve_target() rather than mnt_resolve_spec() for target * move all to get_btrfs_fs_root() * make the basic if/else more readable Please, please, test it. It would be nice to have tests/ts/mount/btrfs with all the "mount -a" variants you have in commit messages. > >- mountinfo contains subvol and subvolid since kernel 4.2. Before kernel > > 4.2, there is no reasonable way to solve this situation. (One would > > create temporary mount point, mount the default, call needed ioctl() to > > determine what was mounted, deduce the default subvolume, compare it > > with subvolume of mounted volume, unmount and return result.) > > There is no reasonable way to detect whether default subvolume was mounted. > > In case of mounting with subvolid, there is a way to detect subvolume path > even before kernel 4.2: If mountinfo lookup fails, then use > btrfs_get_default_subvolume_path(). (See my mail dated > Thu, 21 Jan 2016 18:24:59 +0100 in this thread.) However fix is possible > here, I have no plan to extent > [PATCH 1/2] libmount: run btrfs subvol checks for "subvolid" option > and implement it. It would be a fix of obscure situation in a kernel with > unfixable issues of more common cases. You know, perfect is the enemy of good :-) Thanks 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