btrbk: system_list_mountinfo: also fetch mount_options (not only super_options)

This should have no impact on current code: "subvol" and "subvolid"
are used, which are only in super_options.
pull/299/head
Axel Burri 2019-09-08 18:06:31 +02:00
parent 8570ee585d
commit 8434c6881c
1 changed files with 3 additions and 1 deletions

4
btrbk
View File

@ -1862,13 +1862,15 @@ sub system_list_mountinfo($)
return undef;
}
my %line = %+;
foreach (split(',', $line{super_options})) {
# merge super_options and mount_options to MNTOPS.
foreach (split(',', $line{super_options}), split(',', $line{mount_options})) {
if(/^(.+?)=(.+)$/) {
$line{MNTOPS}->{$1} = $2;
} else {
$line{MNTOPS}->{$_} = 1;
}
}
$line{MNTOPS}->{rw} = 0 if($line{MNTOPS}->{ro}); # e.g. mount_options="ro", super_options="rw"
push @mountinfo, \%line;
}
# TRACE(Data::Dumper->Dump([\@mountinfo], ["mountinfo"])) if($do_dumper);