Re: XFS dmapi: dm_path_to_handle fails if the path is a directory

Vlad Apostolov
2006-11-05T22:38:08Z

John Groves wrote:
>
>
> Vlad Apostolov wrote:
>
>> Just a note that dm_path_to_handle works fine with relative paths on
>> my machine.
>
> In your case, could it be applying the "current working directory"
> from the process context to resolve a full path? Mine is a daemon,
> and the relative paths are not valid relative to the "cwd" in which
> the daemon was started.
>
> ...just a thought. Otherwise, for the moment I may have to just
> accept it as weird...
>
> Thanks again,
> John
I am using

xfs-cmds/xfstests/dmapi/src/suite1/cmd/path_to_handle

and the relative path passed as an argument is directly given to
dm_path_to_handle().
The current working directory
I can't really explain why it doesn't work in your case. Here is an
example of a directory
path to handle I get:

emu:/home/vapo/isms/xfs-cmds/xfstests/dmapi/src/suite1/cmd #
./path_to_handle /mnt/scratch1/dmapi
5d1111a90e4800000e0000006e0000008300000000000000
emu:/home/vapo/isms/xfs-cmds/xfstests/dmapi/src/suite1/cmd #
./path_to_handle ../../../../../../../../../mnt/scratch1/dmapi
5d1111a90e4800000e0000006e0000008300000000000000
emu:/home/vapo/isms/xfs-cmds/xfstests/dmapi/src/suite1/cmd # cd /
emu:/ #
/home/vapo/isms/xfs-cmds/xfstests/dmapi/src/suite1/cmd/path_to_handle
../../../../../../../../../mnt/scratch1/dmapi
5d1111a90e4800000e0000006e0000008300000000000000

Regards,
Vlad