Re: [PATCH RFC v3] nfs: nfs_do_return_delegation() needs to send FREE_STATEID

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

 



Hi Andrew,

On Wed, Nov 4, 2015 at 7:43 PM, Andrew Elble <aweits@xxxxxxx> wrote:
> In the NFS4.1 case, revoked delegations need to be processed via
> FREE_STATEID, not simply forgotten.
>
> Fixes: 869f9dfa4d6d ("NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return")
> Signed-off-by: Andrew Elble <aweits@xxxxxxx>
> ---
>  fs/nfs/delegation.c |  6 ++++++
>  fs/nfs/nfs4_fs.h    |  2 ++
>  fs/nfs/nfs4proc.c   | 18 ++++++++++--------
>  3 files changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
> index 5166adcfc0fb..dc971adb7af9 100644
> --- a/fs/nfs/delegation.c
> +++ b/fs/nfs/delegation.c
> @@ -205,6 +205,12 @@ static int nfs_do_return_delegation(struct inode *inode, struct nfs_delegation *
>                                 delegation->cred,
>                                 &delegation->stateid,
>                                 issync);
> +#if defined(CONFIG_NFS_V4_1)
> +       else if (NFS_SERVER(inode)->nfs_client->cl_minorversion)
> +               res = nfs41_free_stateid(NFS_SERVER(inode),
> +                                       &delegation->stateid,
> +                                       delegation->cred, issync);
> +#endif /* CONFIG_NFS_V4_1 */
>         nfs_free_delegation(delegation);
>         return res;

If the server is revoking a delegation, then presumably it will also
set one or more of the SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED,
SEQ4_STATUS_ADMIN_STATE_REVOKED, SEQ4_STATUS_RECALLABLE_STATE_REVOKED,
which should start up a state manager thread to do the
test_stateid/free_stateid dance.

So instead of adding the free stateid call above, why can't we just
punt the freeing of the delegation to the state manager?

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