]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
add lpath_to_handle to libhandle
authorBill Kendall <wkendall@sgi.com>
Thu, 22 Oct 2009 16:52:23 +0000 (16:52 +0000)
committerAlex Elder <aelder@sgi.com>
Fri, 23 Oct 2009 18:18:59 +0000 (13:18 -0500)
commit24d97575393f0afb01f5475c8cc5678e0df713bc
treee97f834cbb86093ca12d9280403c900ddf29e80a
parentbad0fe5d541323ff47167638ae4a577d9999a67c
add lpath_to_handle to libhandle

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.

Alex Elder is going to take care of bumping the libhandle
minor number, and adjusting the xfsdump/xfsprogs version numbers
and dependencies to ensure a compatible libhandle is installed
for xfsdump.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
include/handle.h
libhandle/handle.c