>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
|