diff options
author | David Sterba <dsterba@suse.cz> | 2011-09-29 13:11:33 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2011-10-24 14:43:25 +0200 |
commit | f9d9ef62cd3ecbd6cbb7957a253c1e81f69d5586 (patch) | |
tree | 34e9cf9c3c5f2332e2e59500de8c5c1ff4065c7b /lib/mpi/mpi-internal.h | |
parent | 20bcd64934e4eb8f3f90a0dca54fb0ac2edd7795 (diff) |
btrfs: do not allow mounting non-subvolumes via subvol option
There's a missing test whether the path passed to subvol=path option
during mount is a real subvolume, allowing any directory located in
default subovlume to be passed and accepted for mount.
(current btrfs progs prevent this early)
$ btrfs subvol snapshot . p1-snap
ERROR: '.' is not a subvolume
(with "is subvolume?" test bypassed)
$ btrfs subvol snapshot . p1-snap
Create a snapshot of '.' in './p1-snap'
$ btrfs subvol list -p .
ID 258 parent 5 top level 5 path subvol
ID 259 parent 5 top level 5 path subvol1
ID 260 parent 5 top level 5 path default-subvol1
ID 262 parent 5 top level 5 path p1/p1-snapshot
ID 263 parent 259 top level 5 path subvol1/subvol1-snap
The problem I see is that this makes a false impression of snapshotting the
given subvolume but in fact snapshots the default one: a user expects outcome
like ID 263 but in fact gets ID 262 .
This patch makes mount fail with EINVAL with a message in syslog.
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'lib/mpi/mpi-internal.h')
0 files changed, 0 insertions, 0 deletions