From: TARUISI Hiroaki <taruishi.hiroak@jp.fujitsu.com>
To: kreijack@libero.it
Cc: linux-btrfs@vger.kernel.org
Subject: Re: BUG: Link from sub volume, then remove the subvolume -> wrong link
Date: Sat, 12 Dec 2009 09:24:56 +0900 [thread overview]
Message-ID: <4B22E2D8.7020706@jp.fujitsu.com> (raw)
In-Reply-To: <200912112054.25986.kreijack@libero.it>
Hi,
I don't know how a hard link becomes to a soft link, hard link
across subvolumes should not allowed in btrfs.
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.
As for this problem, Christian Parpart posted a patch, and
I rebased it.
Regards,
taruisi
(2009/12/12 4:54), Goffredo Baroncelli wrote:
> Hi all
>
> when I tried to reproduce the bug highlighted by Andrew, I discovered another
> bug. When I link a file from a subvolume to another, then remove the subvolume
> I got a wrong link: in my test an *hard* link becomes a *soft* link !!!!
>
> Steps to reproduce the bug:
>
> root@venice:/tmp/test# sudo btrfsctl -S subvol2 .
> operation complete
> Btrfs Btrfs v0.19
> root@venice:/tmp/test# echo 123 >>subvol2/myfile
> root@venice:/tmp/test# ln subvol2/myfile .
> root@venice:/tmp/test# ls -l . subvol2/
> .:
> total 4
> -rw-r--r-- 2 root root 4 2009-12-11 20:40 myfile
> drwx------ 1 root root 12 2009-12-11 20:40 subvol2
>
> subvol2/:
> total 4
> -rw-r--r-- 2 root root 4 2009-12-11 20:40 myfile
> root@venice:/tmp/test# btrfsctl -D subvol2 .
> operation complete
> Btrfs Btrfs v0.19
> root@venice:/tmp/test# ls -l
> total 0
> lrwxrwxrwx 1 root root 3 2009-11-22 10:56 myfile -> lib
>
> Now myfile is a soft link instead to a hard link!!!! Moreover the soft link is
> to an incorrect target ( 1) lib doesn't exist, 2) in any case is not the right
> target).
>
>
> BR
> Goffredo
--
taruisi
next prev parent reply other threads:[~2009-12-12 0:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-11 19:54 BUG: Link from sub volume, then remove the subvolume -> wrong link Goffredo Baroncelli
2009-12-12 0:24 ` TARUISI Hiroaki [this message]
2009-12-12 13:54 ` Goffredo Baroncelli
2009-12-12 18:39 ` Andy Lutomirski
2009-12-13 23:42 ` TARUISI Hiroaki
2009-12-14 18:43 ` Andrew Lutomirski
2009-12-15 0:15 ` TARUISI Hiroaki
2009-12-15 4:04 ` Andy Lutomirski
2009-12-15 17:31 ` David Nicol
2009-12-17 0:00 ` TARUISI Hiroaki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B22E2D8.7020706@jp.fujitsu.com \
--to=taruishi.hiroak@jp.fujitsu.com \
--cc=kreijack@libero.it \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox