public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* Find hardlinks to a file
@ 2014-08-28 23:14 Chris Holcombe
  2014-08-28 23:29 ` Dave Chinner
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Holcombe @ 2014-08-28 23:14 UTC (permalink / raw)
  To: xfs

My apologies if this has already been asked.  I feel that I've done a
sufficient amount of Google search homework.  I'm working with Gluster
(http://www.gluster.org/) and they have a directory called xattrop
where they store links to files that need to be healed.  When I stat
the file I can see that there's 2 or 3 hard links to the file.  I
can't seem to find a way in code or with an xfs_* utility to find the
path of those hard links.  Does anyone know how to do this or if it's
even possible?  From looking through the XFS documentation I don't
really see a way to do it without a find /mount_point -num <number>
brute force method.  btrfs has a utility called:

btrfs inspect-internal inode-resolve [-v] <inode> <path>
              Resolves an <inode> in subvolume <path> to all filesystem
              paths.

I'd like to build an equivalent tool in C for XFS if it's possible.

Thanks,
Chris

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: Find hardlinks to a file
  2014-08-28 23:14 Find hardlinks to a file Chris Holcombe
@ 2014-08-28 23:29 ` Dave Chinner
  2014-08-29  0:51   ` Chris Holcombe
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Chinner @ 2014-08-28 23:29 UTC (permalink / raw)
  To: Chris Holcombe; +Cc: xfs

On Thu, Aug 28, 2014 at 04:14:25PM -0700, Chris Holcombe wrote:
> My apologies if this has already been asked.  I feel that I've done a
> sufficient amount of Google search homework.  I'm working with Gluster
> (http://www.gluster.org/) and they have a directory called xattrop
> where they store links to files that need to be healed.  When I stat
> the file I can see that there's 2 or 3 hard links to the file.  I
> can't seem to find a way in code or with an xfs_* utility to find the
> path of those hard links.  Does anyone know how to do this or if it's
> even possible?  From looking through the XFS documentation I don't
> really see a way to do it without a find /mount_point -num <number>
> brute force method.  btrfs has a utility called:
> 
> btrfs inspect-internal inode-resolve [-v] <inode> <path>
>               Resolves an <inode> in subvolume <path> to all filesystem
>               paths.
> 
> I'd like to build an equivalent tool in C for XFS if it's possible.

You need help from the filesystem, both in terms of the on-disk
format and the kernel code needed to push that information back out
to userspace. Indeed, this is the functionality we need for reverse
inode->path lookups:

http://thread.gmane.org/gmane.comp.file-systems.xfs.general/27772

(parent pointers, for those that don't want to follow the link)

Right now it's state is in limbo. We have a more recent design,
but since SGI has dropped off the edge of the world, nobody is
working on it.

It's on my radar along with reverse mapping btrees for filesystem
block to inode lookups so that we can do all of this sort of stuff
easily without needing to walk the entire filesystem to find the
forward pointers to objects....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: Find hardlinks to a file
  2014-08-28 23:29 ` Dave Chinner
@ 2014-08-29  0:51   ` Chris Holcombe
  2014-08-29  1:15     ` Dave Chinner
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Holcombe @ 2014-08-29  0:51 UTC (permalink / raw)
  To: xfs

So let me ask you this.  Is it possible to transform an inode number
into a path name with xfs?  That's basically the crux of my problem.

On Thu, Aug 28, 2014 at 4:29 PM, Dave Chinner <david@fromorbit.com> wrote:
> On Thu, Aug 28, 2014 at 04:14:25PM -0700, Chris Holcombe wrote:
>> My apologies if this has already been asked.  I feel that I've done a
>> sufficient amount of Google search homework.  I'm working with Gluster
>> (http://www.gluster.org/) and they have a directory called xattrop
>> where they store links to files that need to be healed.  When I stat
>> the file I can see that there's 2 or 3 hard links to the file.  I
>> can't seem to find a way in code or with an xfs_* utility to find the
>> path of those hard links.  Does anyone know how to do this or if it's
>> even possible?  From looking through the XFS documentation I don't
>> really see a way to do it without a find /mount_point -num <number>
>> brute force method.  btrfs has a utility called:
>>
>> btrfs inspect-internal inode-resolve [-v] <inode> <path>
>>               Resolves an <inode> in subvolume <path> to all filesystem
>>               paths.
>>
>> I'd like to build an equivalent tool in C for XFS if it's possible.
>
> You need help from the filesystem, both in terms of the on-disk
> format and the kernel code needed to push that information back out
> to userspace. Indeed, this is the functionality we need for reverse
> inode->path lookups:
>
> http://thread.gmane.org/gmane.comp.file-systems.xfs.general/27772
>
> (parent pointers, for those that don't want to follow the link)
>
> Right now it's state is in limbo. We have a more recent design,
> but since SGI has dropped off the edge of the world, nobody is
> working on it.
>
> It's on my radar along with reverse mapping btrees for filesystem
> block to inode lookups so that we can do all of this sort of stuff
> easily without needing to walk the entire filesystem to find the
> forward pointers to objects....
>
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: Find hardlinks to a file
  2014-08-29  0:51   ` Chris Holcombe
@ 2014-08-29  1:15     ` Dave Chinner
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Chinner @ 2014-08-29  1:15 UTC (permalink / raw)
  To: Chris Holcombe; +Cc: xfs

On Thu, Aug 28, 2014 at 05:51:15PM -0700, Chris Holcombe wrote:
> So let me ask you this.  Is it possible to transform an inode number
> into a path name with xfs?  That's basically the crux of my problem.

$ man xfs_ncheck

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2014-08-29  1:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-28 23:14 Find hardlinks to a file Chris Holcombe
2014-08-28 23:29 ` Dave Chinner
2014-08-29  0:51   ` Chris Holcombe
2014-08-29  1:15     ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox