@@ -130,10 +130,11 @@ nlm4_decode_lock(u32 *p, struct nlm_lock *lock)
130130 || !(p = nlm4_decode_fh (p , & lock -> fh ))
131131 || !(p = nlm4_decode_oh (p , & lock -> oh )))
132132 return NULL ;
133+ lock -> svid = ntohl (* p ++ );
133134
134135 locks_init_lock (fl );
135136 fl -> fl_owner = current -> files ;
136- fl -> fl_pid = ntohl ( * p ++ ) ;
137+ fl -> fl_pid = ( pid_t ) lock -> svid ;
137138 fl -> fl_flags = FL_POSIX ;
138139 fl -> fl_type = F_RDLCK ; /* as good as anything else */
139140 p = xdr_decode_hyper (p , & start );
@@ -167,7 +168,7 @@ nlm4_encode_lock(u32 *p, struct nlm_lock *lock)
167168 || (fl -> fl_end > NLM4_OFFSET_MAX && fl -> fl_end != OFFSET_MAX ))
168169 return NULL ;
169170
170- * p ++ = htonl (fl -> fl_pid );
171+ * p ++ = htonl (lock -> svid );
171172
172173 start = loff_t_to_s64 (fl -> fl_start );
173174 if (fl -> fl_end == OFFSET_MAX )
@@ -198,7 +199,7 @@ nlm4_encode_testres(u32 *p, struct nlm_res *resp)
198199 struct file_lock * fl = & resp -> lock .fl ;
199200
200201 * p ++ = (fl -> fl_type == F_RDLCK )? xdr_zero : xdr_one ;
201- * p ++ = htonl (fl -> fl_pid );
202+ * p ++ = htonl (resp -> lock . svid );
202203
203204 /* Encode owner handle. */
204205 if (!(p = xdr_encode_netobj (p , & resp -> lock .oh )))
@@ -212,8 +213,8 @@ nlm4_encode_testres(u32 *p, struct nlm_res *resp)
212213
213214 p = xdr_encode_hyper (p , start );
214215 p = xdr_encode_hyper (p , len );
215- dprintk ("xdr: encode_testres (status %d pid %d type %d start %Ld end %Ld)\n" ,
216- resp -> status , fl -> fl_pid , fl -> fl_type ,
216+ dprintk ("xdr: encode_testres (status %u pid %d type %d start %Ld end %Ld)\n" ,
217+ resp -> status , ( int ) resp -> lock . svid , fl -> fl_type ,
217218 (long long )fl -> fl_start , (long long )fl -> fl_end );
218219 }
219220
@@ -303,7 +304,8 @@ nlm4svc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
303304
304305 memset (lock , 0 , sizeof (* lock ));
305306 locks_init_lock (& lock -> fl );
306- lock -> fl .fl_pid = ~(u32 ) 0 ;
307+ lock -> svid = ~(u32 ) 0 ;
308+ lock -> fl .fl_pid = (pid_t )lock -> svid ;
307309
308310 if (!(p = nlm4_decode_cookie (p , & argp -> cookie ))
309311 || !(p = xdr_decode_string_inplace (p , & lock -> caller ,
@@ -420,7 +422,8 @@ nlm4clt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
420422 memset (& resp -> lock , 0 , sizeof (resp -> lock ));
421423 locks_init_lock (fl );
422424 excl = ntohl (* p ++ );
423- fl -> fl_pid = ntohl (* p ++ );
425+ resp -> lock .svid = ntohl (* p ++ );
426+ fl -> fl_pid = (pid_t )resp -> lock .svid ;
424427 if (!(p = nlm4_decode_oh (p , & resp -> lock .oh )))
425428 return - EIO ;
426429
0 commit comments