Re: [PATCH 7/8] pnfs-submit: forgetful client (layouts)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2010-06-08 10:51, Alexandros Batsakis wrote:
> On Tue, Jun 8, 2010 at 12:23 AM, Benny Halevy <bhalevy@xxxxxxxxxxx> wrote:
>> On Jun. 08, 2010, 0:11 +0300, Alexandros Batsakis <batsakis@xxxxxxxxxx> wrote:
>>> +                             status = pnfs_async_return_layout(clp, inode,
>>> +                                                               args);
>>> +                             if (status == -EAGAIN)
>>> +                                     res = cpu_to_be32(NFS4ERR_DELAY);
>>
>> what about other errors?
>>
> 
> pnfs_async_return_layout does not send any RPCs, so it's either EAGAIN
> or an "out of memory" error in which case I guess it's better to
> return NFS4ERR_RESOURCE than NFS4ERR_NO_MATCHING_LAYOUT. So you are
> right, I ll send a fix.
> 

Note that NFS4ERR_RESOURCE is no longer a valid status
in nfsv4.1 NFS4ERR_DELAY might be a better choice for -ENOMEM.
NFS4ERR_NO_MATCHING_LAYOUT should never be returned unless
you're sure you have no layout to return or you had one
and forgot everything about it.

For any other error I'd BUG() and return NFS4ERR_DELAY.

>>> +                             iput(inode);
>>>                       }
>>> +             } else { /* _ALL or _FSID */
>>> +                     /* we need the inode to get the nfs_server struct */
>>> +                     inode = nfs_layoutrecall_find_inode(clp, args);
>>> +                     if (!inode)
>>> +                             goto loop;
>>> +                     status = pnfs_async_return_layout(clp, inode, args);
>>> +                     if (status == -EAGAIN)
>>> +                             res = cpu_to_be32(NFS4ERR_DELAY);
>>
>> ditto
>>

<snip>

>>> @@ -1044,7 +1055,7 @@ pnfs_update_layout(struct inode *ino,
>>>       struct nfs4_pnfs_layout_segment arg = {
>>>               .iomode = iomode,
>>>               .offset = 0,
>>> -             .length = ~0
>>> +             .length = NFS4_MAX_UINT64,

sorry, this is just cosmetic (my bad)

Benny
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux