xfs
[Top] [All Lists]

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

To: jgl@xxxxxxxxxxxxxx
Subject: Re: XFS dmapi: dm_path_to_handle fails if the path is a directory
From: Vlad Apostolov <vapo@xxxxxxx>
Date: Mon, 06 Nov 2006 09:37:09 +1100
Cc: John Groves <John@xxxxxxxxxx>, linux-xfs@xxxxxxxxxxx, Dean Roehrich <roehrich@xxxxxxx>
In-reply-to: <454B58E4.6000802@xxxxxxxxxxxxxx>
References: <4547DA70.4040107@xxxxxxxxxx> <4547EDFD.8020407@xxxxxxx> <454A94A6.6040907@xxxxxxxxxxxxxx> <454AAC6B.7010406@xxxxxxx> <454AAF31.8050104@xxxxxxxxxx> <454AB0A0.7050309@xxxxxxx> <454B58E4.6000802@xxxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 1.5.0.7 (X11/20060909)
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


<Prev in Thread] Current Thread [Next in Thread>