@@ -1857,7 +1857,7 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name)
18571857 clp = kmem_cache_zalloc (client_slab , GFP_KERNEL );
18581858 if (clp == NULL )
18591859 return NULL ;
1860- clp -> cl_name . data = kmemdup ( name . data , name . len , GFP_KERNEL );
1860+ xdr_netobj_dup ( & clp -> cl_name , & name , GFP_KERNEL );
18611861 if (clp -> cl_name .data == NULL )
18621862 goto err_no_name ;
18631863 clp -> cl_ownerstr_hashtbl = kmalloc_array (OWNER_HASH_SIZE ,
@@ -1867,7 +1867,6 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name)
18671867 goto err_no_hashtbl ;
18681868 for (i = 0 ; i < OWNER_HASH_SIZE ; i ++ )
18691869 INIT_LIST_HEAD (& clp -> cl_ownerstr_hashtbl [i ]);
1870- clp -> cl_name .len = name .len ;
18711870 INIT_LIST_HEAD (& clp -> cl_sessions );
18721871 idr_init (& clp -> cl_stateids );
18731872 atomic_set (& clp -> cl_rpc_users , 0 );
@@ -4000,12 +3999,11 @@ static inline void *alloc_stateowner(struct kmem_cache *slab, struct xdr_netobj
40003999 if (!sop )
40014000 return NULL ;
40024001
4003- sop -> so_owner . data = kmemdup ( owner -> data , owner -> len , GFP_KERNEL );
4002+ xdr_netobj_dup ( & sop -> so_owner , owner , GFP_KERNEL );
40044003 if (!sop -> so_owner .data ) {
40054004 kmem_cache_free (slab , sop );
40064005 return NULL ;
40074006 }
4008- sop -> so_owner .len = owner -> len ;
40094007
40104008 INIT_LIST_HEAD (& sop -> so_stateids );
40114009 sop -> so_client = clp ;
@@ -6093,12 +6091,11 @@ nfs4_set_lock_denied(struct file_lock *fl, struct nfsd4_lock_denied *deny)
60936091
60946092 if (fl -> fl_lmops == & nfsd_posix_mng_ops ) {
60956093 lo = (struct nfs4_lockowner * ) fl -> fl_owner ;
6096- deny -> ld_owner . data = kmemdup ( lo -> lo_owner .so_owner . data ,
6097- lo -> lo_owner . so_owner . len , GFP_KERNEL );
6094+ xdr_netobj_dup ( & deny -> ld_owner , & lo -> lo_owner .so_owner ,
6095+ GFP_KERNEL );
60986096 if (!deny -> ld_owner .data )
60996097 /* We just don't care that much */
61006098 goto nevermind ;
6101- deny -> ld_owner .len = lo -> lo_owner .so_owner .len ;
61026099 deny -> ld_clientid = lo -> lo_owner .so_client -> cl_clientid ;
61036100 } else {
61046101nevermind :
0 commit comments