Bug 109981

Summary: Unhelpful error message "ERROR: incorrect snapshot name '/'" if snapshot dest is an existing directory
Product: File System Reporter: Karl Richter (krichter722)
Component: btrfsAssignee: Josef Bacik (josef)
Status: NEW ---    
Severity: normal CC: dsterba, szg00000
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.3.3 Subsystem:
Regression: No Bisected commit-id:

Description Karl Richter 2015-12-25 21:29:14 UTC
Steps to reproduce:

  1. cd /tmp; mkdir a;
  2. sudo btrfs subvolume snapshot / /tmp/a

causes `ERROR: incorrect snapshot name '/'` whereas `ERROR /tmp/a is an existing directory` would be way more helpful

experienced with `btrfs-progs` 4.3.1
Comment 1 David Sterba 2016-01-13 16:25:48 UTC
Actually the problem is in '/' in the source path (or '.'). If you create another subvolume (say b), do 'snapshot b a', then it works and creates 'a/b'. This behaviour is consistent with 'cp' copying directories, but there's a bug in btrfs-progs that mistakenly refuses to use '/' or '.' as source subvolume.