Ben Hutchings
2012-Jun-14 04:34 UTC
Re: btrfs: filenames collide with snapshot/subvolume names
Γιώργος (Giorgos?) reports:> Namely, being inside a snapshot directory, I can''t create a file/directory > with the name of the snapshot directory. > > For example, inside /mnt/aSnap, I can''t create a file named ''aSnap'', so I''m > filling this bug report.It seems that the snapshot directory is partially created before the snapshot is taken, so that the snapshot directory half-exists (can be looked up, but doesn''t appear in listings) inside the snapshot itself. This doesn''t seem to be the recommended way to organise subvolumes, but it seems like it should at least result in a coherent filesystem within each subvolume. Ben.> Below follows full reproduction of this behavior: > > aris tmp # dd if=/dev/zero of=FILE bs=4k seek=`echo 5*1024*1024 | bc` count=1 > 1+0 records in > 1+0 records out > 4096 bytes (4.1 kB) copied, 1.8695e-05 s, 219 MB/s > aris tmp # losetup /dev/loop0 FILE > aris tmp # losetup -a > /dev/loop0: [fe01]:263872 (/tmp/FILE) > aris tmp # mkfs.btrfs -Ltest /dev/loop0 > > WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL > WARNING! - see http://btrfs.wiki.kernel.org before using > > fs created label test on /dev/loop0 > nodesize 4096 leafsize 4096 sectorsize 4096 size 20.00GB > Btrfs Btrfs v0.19 > aris tmp # mount /dev/loop0 /mnt/ > aris tmp # cd /mnt > aris mnt # ls -la > total 8 > dr-xr-xr-x 1 root root 0 Mar 8 12:07 . > drwxr-xr-x 24 root root 4096 Mar 8 11:41 .. > aris mnt # mkdir dir1 > aris mnt # mkdir dir2 > aris mnt # mkdir dir3 > aris mnt # l > total 0 > drwxr-xr-x 1 root root 0 Mar 8 12:08 dir1 > drwxr-xr-x 1 root root 0 Mar 8 12:08 dir2 > drwxr-xr-x 1 root root 0 Mar 8 12:08 dir3 > aris mnt # btrfs subvolume snapshot /mnt/ /mnt/aSnap > Create a snapshot of ''/mnt/'' in ''/mnt/aSnap'' > aris mnt # cd /mnt/aSnap/ > aris aSnap # ls -la > total 8 > dr-xr-xr-x 1 root root 34 Mar 8 12:08 . > dr-xr-xr-x 1 root root 34 Mar 8 12:08 .. > drwxr-xr-x 1 root root 0 Mar 8 12:08 dir1 > drwxr-xr-x 1 root root 0 Mar 8 12:08 dir2 > drwxr-xr-x 1 root root 0 Mar 8 12:08 dir3 > aris aSnap # date > aSnap > bash: aSnap: Is a directory-- Ben Hutchings Computers are not intelligent. They only think they are.
David Sterba
2012-Jun-14 10:28 UTC
Re: btrfs: filenames collide with snapshot/subvolume names
On Thu, Jun 14, 2012 at 05:34:29AM +0100, Ben Hutchings wrote:> ?????????????? (Giorgos?) reports: > > Namely, being inside a snapshot directory, I can''t create a file/directory > > with the name of the snapshot directory. > > > > For example, inside /mnt/aSnap, I can''t create a file named ''aSnap'', so I''m > > filling this bug report. > > It seems that the snapshot directory is partially created before the > snapshot is taken, so that the snapshot directory half-exists (can be > looked up, but doesn''t appear in listings) inside the snapshot itself.I think it''s this one, not merged so far (author CCed) http://www.spinics.net/lists/linux-btrfs/msg15195.html david -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Ben Hutchings
2012-Jun-24 22:53 UTC
Re: btrfs: filenames collide with snapshot/subvolume names
On Thu, 2012-06-14 at 12:28 +0200, David Sterba wrote:> On Thu, Jun 14, 2012 at 05:34:29AM +0100, Ben Hutchings wrote: > > ?????????????? (Giorgos?) reports: > > > Namely, being inside a snapshot directory, I can''t create a file/directory > > > with the name of the snapshot directory. > > > > > > For example, inside /mnt/aSnap, I can''t create a file named ''aSnap'', so I''m > > > filling this bug report. > > > > It seems that the snapshot directory is partially created before the > > snapshot is taken, so that the snapshot directory half-exists (can be > > looked up, but doesn''t appear in listings) inside the snapshot itself. > > I think it''s this one, not merged so far (author CCed) > http://www.spinics.net/lists/linux-btrfs/msg15195.htmlThanks, that sounds like it addresses this. I''ll wait for that patch or another fix to be applied, as I am not able to assess whether it''s reasonable. Ben. -- Ben Hutchings I say we take off; nuke the site from orbit. It''s the only way to be sure.