xfs
[Top] [All Lists]

Re: [DMAPI] code error in dm_ip_to_handle()

To: Aurelien Degremont - Stagiaire <degremont@xxxxxxxxxxx>
Subject: Re: [DMAPI] code error in dm_ip_to_handle()
From: Dean Roehrich <roehrich@xxxxxxx>
Date: Mon, 16 May 2005 10:18:15 -0500
Cc: linux-xfs@xxxxxxxxxxx
Sender: linux-xfs-bounce@xxxxxxxxxxx
>From:  Aurelien Degremont - Stagiaire <degremont@xxxxxxxxxxx>
>Dean Roehrich a écrit:
>>> - fh_to_inode() must test the fid_len field and return the root inode 
>>>number if its value is zero.
>> 
>> 
>> No.  fh_to_inode() doesn't have to modify the dm_fsfid at all.  It just need
>s
>> to check that it refers to a valid inode, and then it needs to return that
>> inode.
>
>I'm sorry if I was unclear here.
>I never said dmfsfid need to be modified. We just check its fid_len, 
>return the root inode if null or return the file inode refers by the 
>filehandle otherwise.
>When the inode number is known, try to get it with a iget(), if the iget 
>succeeded, the inode was correct, else, return an error.

Yes, that sounds right.


>         else
>         {
>                 memcpy(&fid, dmfsfid, sizeof(fid));
>                 ino = fid.dm_fid_ino; /* memcpy() here ? */
>         }
> 
>
>         *ip = iget(sb, ino);
>         if (*ip == NULL)
>                 error = EIO;

For the filehandle case, you need to verify that dm_fid_gen matches
i_generation.

Dean


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