linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Schmidt <list.btrfs@jan-o-sch.net>
To: Li Zefan <lizf@cn.fujitsu.com>, linux-btrfs@vger.kernel.org
Cc: Jan Schmidt <list.btrfs@jan-o-sch.net>, chris.mason@oracle.com
Subject: Re: [PATCH v8 1/8] btrfs: added helper functions to iterate backrefs
Date: Thu, 03 Nov 2011 11:32:35 +0100	[thread overview]
Message-ID: <4EB26DC3.5080409@jan-o-sch.net> (raw)
In-Reply-To: <4EB1F13C.3070801@cn.fujitsu.com>

On 03.11.2011 02:41, Li Zefan wrote:
> (as this is going to be merged into mainline..)
> 
>> +/*
>> + * calls iterate() for every inode that references the extent identified by
>> + * the given parameters. will use the path given as a parameter and return it
>> + * released.
>> + * when the iterator function returns a non-zero value, iteration stops.
>> + */
>> +int iterate_extent_inodes(struct btrfs_fs_info *fs_info,
>> +				struct btrfs_path *path,
>> +				u64 extent_item_objectid,
>> +				u64 extent_offset,
>> +				iterate_extent_inodes_t *iterate, void *ctx)
> 
> While trying to use this API, I found there's a big defect in this function.
> 
>    fs_tree 1       fs_tree 2
>        \              /
>         \            /
>          \          /
>           \        /
>              node
>               |
>               |
>              leaf  (EXTENT_DATA item)
> 
> In the above case, the function will find only 1 reference.

Hum. You are right.

I'm convinced that I've been at this point months ago, only I cannot
find code dealing with counts > 1 on nodes. I'll look for a fix in my
branches or make a new one.

I also recognized that some "btrfs_" prefixes are missing for the
exported functions. I'm going to change this on the next iteration as well.

Currently, this is more of a best-effort resolver. Support for delayed
extents is missing, it should be used on commit roots to get a
consistent state.

For the userspace part, at least the simple scenario outlined isn't
crucial as "btrfs inspect-internal logical-resolve" will find each of
the two paths, depending on the subvolume path you specify. It never
finds both, though, which I agree it should.

Sigh,
-Jan

  reply	other threads:[~2011-11-03 10:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27 14:56 [PATCH v8 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup Jan Schmidt
2011-07-27 14:56 ` [PATCH v8 1/8] btrfs: added helper functions to iterate backrefs Jan Schmidt
2011-11-03  1:41   ` Li Zefan
2011-11-03 10:32     ` Jan Schmidt [this message]
2011-11-07 16:46       ` Arne Jansen
2011-07-27 14:56 ` [PATCH v8 2/8] btrfs scrub: added unverified_errors Jan Schmidt
2011-07-27 14:56 ` [PATCH v8 3/8] btrfs scrub: print paths of corrupted files Jan Schmidt
2011-07-27 14:56 ` [PATCH v8 4/8] btrfs scrub: bugfix: mirror_num off by one Jan Schmidt
2011-07-27 14:56 ` [PATCH v8 5/8] btrfs: add mirror_num to extent_read_full_page Jan Schmidt
2011-07-27 14:56 ` [PATCH v8 6/8] btrfs scrub: use int for mirror_num, not u64 Jan Schmidt
2011-07-27 14:56 ` [PATCH v8 7/8] btrfs scrub: add fixup code for errors on nodatasum files Jan Schmidt
2011-07-27 14:56 ` [PATCH v8 8/8] btrfs: new ioctls to do logical->inode and inode->path resolving Jan Schmidt
2011-07-27 16:39 ` [PATCH v8 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup Jan Schubert
2011-07-27 22:34   ` Jan Schubert
2011-07-28 14:44     ` Jan Schubert
2011-07-28 17:00       ` Jan Schmidt
2011-07-29 15:53         ` Jan Schubert

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=4EB26DC3.5080409@jan-o-sch.net \
    --to=list.btrfs@jan-o-sch.net \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    /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;
as well as URLs for NNTP newsgroup(s).