From: Christoph Hellwig <hch@infradead.org>
To: Bill Kendall <wkendall@sgi.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/2] add lpath_to_handle to libhandle
Date: Sat, 24 Oct 2009 09:39:05 -0400 [thread overview]
Message-ID: <20091024133904.GB23125@infradead.org> (raw)
In-Reply-To: <4AE08DC7.7000200@sgi.com>
On Thu, Oct 22, 2009 at 11:52:23AM -0500, Bill Kendall wrote:
> path_to_handle() is not reliable when called on a path which
> is a symlink. If the symlink is dangling, or if its points
> to a non-XFS filesystem then path_to_handle() will fail. The
> reason is that path_to_handle() must open the path in order
> to obtain an fd for the xfsctl call.
>
> It's common during xfsrestore to have dangling symlinks since
> the target of the link may not be restored before the symlink.
>
> This patch adds a new function to libhandle, lpath_to_handle.
> It is just like path_to_handle, except it takes a filesystem
> path in addition to the path which you want convert to a
> handle.
I'm not sure this is a good API. We can derive a useful path for
the ioctl by using basename on the filename if it is a link without
needing to expose the details to the caller.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2009-10-24 13:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-22 16:52 [PATCH 1/2] add lpath_to_handle to libhandle Bill Kendall
2009-10-23 18:08 ` Alex Elder
2009-10-24 13:37 ` Christoph Hellwig
2009-10-25 2:52 ` Christoph Hellwig
2009-10-24 13:39 ` Christoph Hellwig [this message]
2009-12-21 23:56 ` Bill Kendall
2009-12-23 13:15 ` Christoph Hellwig
2009-12-23 19:21 ` Bill Kendall
2010-01-06 17:41 ` Christoph Hellwig
2009-10-25 3:44 ` Christoph Hellwig
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=20091024133904.GB23125@infradead.org \
--to=hch@infradead.org \
--cc=wkendall@sgi.com \
--cc=xfs@oss.sgi.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