All of lore.kernel.org
 help / color / mirror / Atom feed
* Backref walking utilities
@ 2011-05-23  9:53 liubo
  2011-05-23 10:02 ` Arne Jansen
  0 siblings, 1 reply; 5+ messages in thread
From: liubo @ 2011-05-23  9:53 UTC (permalink / raw)
  To: Chris Mason; +Cc: Linux Btrfs

Hi,

As one of my plans, I'm going to take this project over unless someone has been working on it.

>From wiki, quote:
    Backref walking utilities

    Given a block number on a disk, the Btrfs metadata can find all the files and directories
    that use or care about that block.  Some utilities to walk these back refs and print the
    results would help debug corruptions.

    Given an inode, the Btrfs metadata can find all the directories that point to the inode.
    We should have utils to walk these back refs as well. 
end quote.

And I have some thoughts to share with you:

    - Clearly, this is going to be another command.  Just like the command "btrfs-debug-tree",
      btrfs-walk-backref also needs to be able to track btrfs's metadata in
          a) the offline situation (at a umount state), or
          b) the corrupted situation.

    - For block number, the main goal is to find relative extent backrefs.  When it comes to
      those shared blocks, maybe things will be more complex.

    - For inode, the main goal is to find relative inode refs.  And we should be cautious about
      a) an inode with hard links, b) snapshot.

Did I miss or misunderstand something?  Any comments are welcomed. :)

thanks,
liubo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Backref walking utilities
  2011-05-23  9:53 Backref walking utilities liubo
@ 2011-05-23 10:02 ` Arne Jansen
  2011-05-23 10:15   ` Hugo Mills
  2011-05-25 15:08   ` Jan Schmidt
  0 siblings, 2 replies; 5+ messages in thread
From: Arne Jansen @ 2011-05-23 10:02 UTC (permalink / raw)
  To: liubo; +Cc: Chris Mason, Linux Btrfs

Hi liubo,

On 23.05.2011 11:53, liubo wrote:
> As one of my plans, I'm going to take this project over unless someone has been working on it.

Jan Schmidt has a patch for scrub nearly ready, that does some
ref-walking to report affected files to the user. While this is
kernel code and you're planning to add user-space code, it might
still be possible to share some of it. Maybe the efforts can be
coordinated.

Thanks
Arne

> 
>>From wiki, quote:
>     Backref walking utilities
> 
>     Given a block number on a disk, the Btrfs metadata can find all the files and directories
>     that use or care about that block.  Some utilities to walk these back refs and print the
>     results would help debug corruptions.
> 
>     Given an inode, the Btrfs metadata can find all the directories that point to the inode.
>     We should have utils to walk these back refs as well. 
> end quote.
> 
> And I have some thoughts to share with you:
> 
>     - Clearly, this is going to be another command.  Just like the command "btrfs-debug-tree",
>       btrfs-walk-backref also needs to be able to track btrfs's metadata in
>           a) the offline situation (at a umount state), or
>           b) the corrupted situation.
> 
>     - For block number, the main goal is to find relative extent backrefs.  When it comes to
>       those shared blocks, maybe things will be more complex.
> 
>     - For inode, the main goal is to find relative inode refs.  And we should be cautious about
>       a) an inode with hard links, b) snapshot.
> 
> Did I miss or misunderstand something?  Any comments are welcomed. :)
> 
> thanks,
> liubo
> --
> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Backref walking utilities
  2011-05-23 10:02 ` Arne Jansen
@ 2011-05-23 10:15   ` Hugo Mills
  2011-05-25 15:08   ` Jan Schmidt
  1 sibling, 0 replies; 5+ messages in thread
From: Hugo Mills @ 2011-05-23 10:15 UTC (permalink / raw)
  To: Arne Jansen; +Cc: liubo, Chris Mason, Linux Btrfs

[-- Attachment #1: Type: text/plain, Size: 2407 bytes --]

On Mon, May 23, 2011 at 12:02:21PM +0200, Arne Jansen wrote:
> Hi liubo,
> 
> On 23.05.2011 11:53, liubo wrote:
> > As one of my plans, I'm going to take this project over unless someone has been working on it.
> 
> Jan Schmidt has a patch for scrub nearly ready, that does some
> ref-walking to report affected files to the user. While this is
> kernel code and you're planning to add user-space code, it might
> still be possible to share some of it. Maybe the efforts can be
> coordinated.

   Another use for walking backrefs for a block (or an extent) is to
work out the differential size of a snapshot -- i.e. how much space
will be freed up if the snapshot is deleted. (You need to look at
every extent of every file in the snapshot, and work out whether those
extents are used anywhere outside the subvolume).

   Hugo.

> Thanks
> Arne
> 
> > 
> >>From wiki, quote:
> >     Backref walking utilities
> > 
> >     Given a block number on a disk, the Btrfs metadata can find all the files and directories
> >     that use or care about that block.  Some utilities to walk these back refs and print the
> >     results would help debug corruptions.
> > 
> >     Given an inode, the Btrfs metadata can find all the directories that point to the inode.
> >     We should have utils to walk these back refs as well. 
> > end quote.
> > 
> > And I have some thoughts to share with you:
> > 
> >     - Clearly, this is going to be another command.  Just like the command "btrfs-debug-tree",
> >       btrfs-walk-backref also needs to be able to track btrfs's metadata in
> >           a) the offline situation (at a umount state), or
> >           b) the corrupted situation.
> > 
> >     - For block number, the main goal is to find relative extent backrefs.  When it comes to
> >       those shared blocks, maybe things will be more complex.
> > 
> >     - For inode, the main goal is to find relative inode refs.  And we should be cautious about
> >       a) an inode with hard links, b) snapshot.
> > 
> > Did I miss or misunderstand something?  Any comments are welcomed. :)
> > 
> > thanks,
> > liubo

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
   --- We are all lying in the gutter,  but some of us are looking ---   
                              at the stars.                              

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Backref walking utilities
  2011-05-23 10:02 ` Arne Jansen
  2011-05-23 10:15   ` Hugo Mills
@ 2011-05-25 15:08   ` Jan Schmidt
  2011-05-26  1:51     ` liubo
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Schmidt @ 2011-05-25 15:08 UTC (permalink / raw)
  To: Linux Btrfs

On 05/23/2011 12:02 PM, Arne Jansen wrote:
> Hi liubo,
> 
> On 23.05.2011 11:53, liubo wrote:
>> As one of my plans, I'm going to take this project over unless someone has been working on it.
> 
> Jan Schmidt has a patch for scrub nearly ready, that does some
> ref-walking to report affected files to the user. While this is
> kernel code and you're planning to add user-space code, it might
> still be possible to share some of it. Maybe the efforts can be
> coordinated.

The patches are ready and should be flexible enough to use for your
purpose. However I use them in context of the scrub code, thus I'm
planning to send them out as soon as the current version of scrub is
included in Chris' master.

If anybody wants to test the patches before that (apply well against
Arnes scrub branch), drop me an email.

-Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Backref walking utilities
  2011-05-25 15:08   ` Jan Schmidt
@ 2011-05-26  1:51     ` liubo
  0 siblings, 0 replies; 5+ messages in thread
From: liubo @ 2011-05-26  1:51 UTC (permalink / raw)
  To: Jan Schmidt; +Cc: Linux Btrfs

On 05/25/2011 11:08 PM, Jan Schmidt wrote:
> On 05/23/2011 12:02 PM, Arne Jansen wrote:
>> Hi liubo,
>>
>> On 23.05.2011 11:53, liubo wrote:
>>> As one of my plans, I'm going to take this project over unless someone has been working on it.
>> Jan Schmidt has a patch for scrub nearly ready, that does some
>> ref-walking to report affected files to the user. While this is
>> kernel code and you're planning to add user-space code, it might
>> still be possible to share some of it. Maybe the efforts can be
>> coordinated.
> 
> The patches are ready and should be flexible enough to use for your
> purpose. However I use them in context of the scrub code, thus I'm
> planning to send them out as soon as the current version of scrub is
> included in Chris' master.
> 
> If anybody wants to test the patches before that (apply well against
> Arnes scrub branch), drop me an email.
> 

I'd like to have a look ahead.  Would you please give the address of these patches?

thanks,
liubo

> -Jan
> --
> 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
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-26  1:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23  9:53 Backref walking utilities liubo
2011-05-23 10:02 ` Arne Jansen
2011-05-23 10:15   ` Hugo Mills
2011-05-25 15:08   ` Jan Schmidt
2011-05-26  1:51     ` liubo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.