Re: [PATCH v2] NFSv4.1: new layout stateid can not be overwrite by one out of date

Trond Myklebust
2014-02-12T12:34:43Z

On Feb 12, 2014, at 5:06, shaobingqing <shaobingqing@bwstor.com.cn> wrote:

> If initiate_file_draining returned NFS4ERR_DELAY, all the lsegs of
> a file might be released before the retrying cb_layout request arriving
> at the client. In this situation, layoutget request of the file will
> use open stateid to obtain a new layout stateid. And if the retrying
> cb_layout request arrived at the client after the layoutget reply,
> new layout stateid would be overwrite by one out of date.
>
> Signed-off-by: shaobingqing <shaobingqing@bwstor.com.cn>
> ---
> fs/nfs/callback.h | 5 +++++
> fs/nfs/callback_proc.c | 24 ++++++++++++++++++++++++
> fs/nfs/inode.c | 1 +
> include/linux/nfs_fs.h | 1 +
> 4 files changed, 31 insertions(+), 0 deletions(-)
>
<snip>
> diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
> index 3ea4cde..ba47870 100644
> --- a/include/linux/nfs_fs.h
> +++ b/include/linux/nfs_fs.h
> @@ -181,6 +181,7 @@ struct nfs_inode {
> struct nfs4_cached_acl *nfs4_acl;
> /* NFSv4 state */
> struct list_head open_states;
> + struct list_head cb_stale_state_list;
> struct nfs_delegation __rcu *delegation;
> fmode_t delegation_state;
> struct rw_semaphore rwsem;

No. We are definitely not adding new fields to the inode in order to track old layout stateids.
_________________________________
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust@primarydata.com