Re: [PATCH 1/1] Recover from stateid-type error on SETATTR

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

 



Hey Trond,

On 06/12/2015 02:37 PM, Trond Myklebust wrote:
> Hi Olga,
> 
> On Fri, Jun 12, 2015 at 2:30 PM, Olga Kornievskaia <kolga@xxxxxxxxxx> wrote:
>> Client can receives stateid-type error (eg., BAD_STATEID) on SETATTR when
>> delegation stateid was used. When no open state exists, in case of application
>> calling truncate() on the file, client has no state to recover and fails with
>> EIO.
>>
>> Instead, upon such error, return the bad delegation and then resend the
>> SETATTR with a zero stateid.
>>
>> Signed-off: Olga Kornievskaia <kolga@xxxxxxxxxx>
>> ---
>>  fs/nfs/delegation.h | 6 ++++++
>>  fs/nfs/nfs4proc.c   | 7 ++++++-
>>  2 files changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h
>> index e3c20a3..e37165f 100644
>> --- a/fs/nfs/delegation.h
>> +++ b/fs/nfs/delegation.h
>> @@ -62,6 +62,12 @@ void nfs_mark_delegation_referenced(struct nfs_delegation *delegation);
>>  int nfs4_have_delegation(struct inode *inode, fmode_t flags);
>>  int nfs4_check_delegation(struct inode *inode, fmode_t flags);
>>
>> +static inline int nfs4_have_any_delegation(struct inode *inode)
>> +{
>> +       struct nfs_inode *nfsi = NFS_I(inode);
>> +       return rcu_access_pointer(nfsi->delegation) ? 1 : 0;
>> +}
> 
> What would this do that isn't already covered by
> nfs4_have_delegation(inode, FMODE_READ)?

It looks like _nfs4_do_settattr() can select between FMODE_READ and FMODE_WRITE, so wouldn't we otherwise need to call nfs4_have_delegation() twice?  Or am I missing something?

Anna

> 
> Cheers
>   Trond
> 

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