diff options
author | Benedikt Morbach <benedikt.morbach@googlemail.com> | 2017-02-22 23:56:36 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-03-16 17:02:44 +0100 |
commit | 30c7b11f7f030756d97711cef86c9891efc1d3ee (patch) | |
tree | 2bc1e158f3ff6f8d6c2fdf44669c88736a5b77bb /fsfeatures.c | |
parent | 3e5700f4ddc36b6e13f5d8ae86f658c820e1e33b (diff) |
btrfs-progs: receive: better error reporting for snapshots
Two fixes:
1)
Check that the parent subvol actually is reachable via our root path.
The previous code wouldn't catch
parent subvol: foo/bar
root path: bar (i.e. mounted with -o subvol=bar)
where the parent isn't reachable from the root path.
(but the original "strstr(parent, root_path) == NULL" check still doesn't hold)
Also check for the slash after "root_path", i.e. throw an error on
parent subvol: foobar
root path: foo
2)
If the parent subvol is the one that is mounted we obviously can't
receive into it, as it has to be read-only by definition.
We'd get a rather cryptic:
At subvol /tmp/test/dest.snap
At snapshot dest.snap
ERROR: creating snapshot / -> dest.snap failed: Invalid cross-device link
(not sure what it says if "/" isn't even a btrfs)
But with this we get
At subvol /tmp/test/dest.snap
At snapshot dest.snap
ERROR: creating snapshot . -> dest.snap failed: Read-only file system
which is both more helpful and more correct.
Signed-off-by: Benedikt Morbach <benedikt.morbach@googlemail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fsfeatures.c')
0 files changed, 0 insertions, 0 deletions