On Saturday 12 December 2009, TARUISI Hiroaki wrote:
> Hi,
> 
>  I don't know how a hard link becomes to a soft link, hard link
> across subvolumes should not allowed in btrfs.
I try an explanation below

> 
>  Hard link contains target inode number but not target tree.
> So, if we can create such hard link normally, it points to
> a file which has same inode number in same subvolume.

I can add further details. The next boot my machine was un-bootable. The 
reasons was that the *soft link* /lib64 (which pointed to /lib) was wrong.

My explanation of the fact is:
- In my root there was the link "/lib64 -> lib"; the file /lib64 had inode 
number = 257.
- I created a subvolume for my test. Under this subvolume I created a file 
(called "myfile") which (casually) had inode number = 257.
- I hard linked the  file "myfile" (which inode number 257) in my root volume.
- Unfortunately the inode number of the linked file, existed already and was 
the one of the /lib64 link.
- When I removed the subvolume used for my test, the two file (/lib64 and the 
linked target) exchanged its content and the hard-link becames a soft link and 
vice-versa.

The final results was:
- an unbootable machine
- three files with the same inode (and with a ref count equal to two !!)

On the basis of the facts above, I suggest to Chris to raise the importance of 
the patch of TARUISI Hiroaki (see email [PATCH] Deny sys_link across 
subvolumes 12/11/2009).

BR
Goffredo



-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijackATinwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to