hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/fs/nfsd/nfs3proc.c
....@@ -15,8 +15,6 @@
1515
1616 #define NFSDDBG_FACILITY NFSDDBG_PROC
1717
18
-#define RETURN_STATUS(st) { resp->status = (st); return (st); }
19
-
2018 static int nfs3_ftypes[] = {
2119 0, /* NF3NON */
2220 S_IFREG, /* NF3REG */
....@@ -34,7 +32,7 @@
3432 static __be32
3533 nfsd3_proc_null(struct svc_rqst *rqstp)
3634 {
37
- return nfs_ok;
35
+ return rpc_success;
3836 }
3937
4038 /*
....@@ -45,20 +43,19 @@
4543 {
4644 struct nfsd_fhandle *argp = rqstp->rq_argp;
4745 struct nfsd3_attrstat *resp = rqstp->rq_resp;
48
- __be32 nfserr;
4946
5047 dprintk("nfsd: GETATTR(3) %s\n",
5148 SVCFH_fmt(&argp->fh));
5249
5350 fh_copy(&resp->fh, &argp->fh);
54
- nfserr = fh_verify(rqstp, &resp->fh, 0,
55
- NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
56
- if (nfserr)
57
- RETURN_STATUS(nfserr);
51
+ resp->status = fh_verify(rqstp, &resp->fh, 0,
52
+ NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
53
+ if (resp->status != nfs_ok)
54
+ goto out;
5855
59
- nfserr = fh_getattr(&resp->fh, &resp->stat);
60
-
61
- RETURN_STATUS(nfserr);
56
+ resp->status = fh_getattr(&resp->fh, &resp->stat);
57
+out:
58
+ return rpc_success;
6259 }
6360
6461 /*
....@@ -69,15 +66,14 @@
6966 {
7067 struct nfsd3_sattrargs *argp = rqstp->rq_argp;
7168 struct nfsd3_attrstat *resp = rqstp->rq_resp;
72
- __be32 nfserr;
7369
7470 dprintk("nfsd: SETATTR(3) %s\n",
7571 SVCFH_fmt(&argp->fh));
7672
7773 fh_copy(&resp->fh, &argp->fh);
78
- nfserr = nfsd_setattr(rqstp, &resp->fh, &argp->attrs,
79
- argp->check_guard, argp->guardtime);
80
- RETURN_STATUS(nfserr);
74
+ resp->status = nfsd_setattr(rqstp, &resp->fh, &argp->attrs,
75
+ argp->check_guard, argp->guardtime);
76
+ return rpc_success;
8177 }
8278
8379 /*
....@@ -88,7 +84,6 @@
8884 {
8985 struct nfsd3_diropargs *argp = rqstp->rq_argp;
9086 struct nfsd3_diropres *resp = rqstp->rq_resp;
91
- __be32 nfserr;
9287
9388 dprintk("nfsd: LOOKUP(3) %s %.*s\n",
9489 SVCFH_fmt(&argp->fh),
....@@ -98,11 +93,10 @@
9893 fh_copy(&resp->dirfh, &argp->fh);
9994 fh_init(&resp->fh, NFS3_FHSIZE);
10095
101
- nfserr = nfsd_lookup(rqstp, &resp->dirfh,
102
- argp->name,
103
- argp->len,
104
- &resp->fh);
105
- RETURN_STATUS(nfserr);
96
+ resp->status = nfsd_lookup(rqstp, &resp->dirfh,
97
+ argp->name, argp->len,
98
+ &resp->fh);
99
+ return rpc_success;
106100 }
107101
108102 /*
....@@ -113,7 +107,6 @@
113107 {
114108 struct nfsd3_accessargs *argp = rqstp->rq_argp;
115109 struct nfsd3_accessres *resp = rqstp->rq_resp;
116
- __be32 nfserr;
117110
118111 dprintk("nfsd: ACCESS(3) %s 0x%x\n",
119112 SVCFH_fmt(&argp->fh),
....@@ -121,8 +114,8 @@
121114
122115 fh_copy(&resp->fh, &argp->fh);
123116 resp->access = argp->access;
124
- nfserr = nfsd_access(rqstp, &resp->fh, &resp->access, NULL);
125
- RETURN_STATUS(nfserr);
117
+ resp->status = nfsd_access(rqstp, &resp->fh, &resp->access, NULL);
118
+ return rpc_success;
126119 }
127120
128121 /*
....@@ -133,15 +126,14 @@
133126 {
134127 struct nfsd3_readlinkargs *argp = rqstp->rq_argp;
135128 struct nfsd3_readlinkres *resp = rqstp->rq_resp;
136
- __be32 nfserr;
137129
138130 dprintk("nfsd: READLINK(3) %s\n", SVCFH_fmt(&argp->fh));
139131
140132 /* Read the symlink. */
141133 fh_copy(&resp->fh, &argp->fh);
142134 resp->len = NFS3_MAXPATHLEN;
143
- nfserr = nfsd_readlink(rqstp, &resp->fh, argp->buffer, &resp->len);
144
- RETURN_STATUS(nfserr);
135
+ resp->status = nfsd_readlink(rqstp, &resp->fh, argp->buffer, &resp->len);
136
+ return rpc_success;
145137 }
146138
147139 /*
....@@ -152,7 +144,6 @@
152144 {
153145 struct nfsd3_readargs *argp = rqstp->rq_argp;
154146 struct nfsd3_readres *resp = rqstp->rq_resp;
155
- __be32 nfserr;
156147 u32 max_blocksize = svc_max_payload(rqstp);
157148 unsigned long cnt = min(argp->count, max_blocksize);
158149
....@@ -169,17 +160,10 @@
169160 svc_reserve_auth(rqstp, ((1 + NFS3_POST_OP_ATTR_WORDS + 3)<<2) + resp->count +4);
170161
171162 fh_copy(&resp->fh, &argp->fh);
172
- nfserr = nfsd_read(rqstp, &resp->fh,
173
- argp->offset,
174
- rqstp->rq_vec, argp->vlen,
175
- &resp->count);
176
- if (nfserr == 0) {
177
- struct inode *inode = d_inode(resp->fh.fh_dentry);
178
- resp->eof = nfsd_eof_on_read(cnt, resp->count, argp->offset,
179
- inode->i_size);
180
- }
181
-
182
- RETURN_STATUS(nfserr);
163
+ resp->status = nfsd_read(rqstp, &resp->fh, argp->offset,
164
+ rqstp->rq_vec, argp->vlen, &resp->count,
165
+ &resp->eof);
166
+ return rpc_success;
183167 }
184168
185169 /*
....@@ -190,7 +174,6 @@
190174 {
191175 struct nfsd3_writeargs *argp = rqstp->rq_argp;
192176 struct nfsd3_writeres *resp = rqstp->rq_resp;
193
- __be32 nfserr;
194177 unsigned long cnt = argp->len;
195178 unsigned int nvecs;
196179
....@@ -209,13 +192,16 @@
209192 resp->committed = argp->stable;
210193 nvecs = svc_fill_write_vector(rqstp, rqstp->rq_arg.pages,
211194 &argp->first, cnt);
212
- if (!nvecs)
213
- RETURN_STATUS(nfserr_io);
214
- nfserr = nfsd_write(rqstp, &resp->fh, argp->offset,
215
- rqstp->rq_vec, nvecs, &cnt,
216
- resp->committed);
195
+ if (!nvecs) {
196
+ resp->status = nfserr_io;
197
+ goto out;
198
+ }
199
+ resp->status = nfsd_write(rqstp, &resp->fh, argp->offset,
200
+ rqstp->rq_vec, nvecs, &cnt,
201
+ resp->committed, resp->verf);
217202 resp->count = cnt;
218
- RETURN_STATUS(nfserr);
203
+out:
204
+ return rpc_success;
219205 }
220206
221207 /*
....@@ -230,7 +216,6 @@
230216 struct nfsd3_diropres *resp = rqstp->rq_resp;
231217 svc_fh *dirfhp, *newfhp = NULL;
232218 struct iattr *attr;
233
- __be32 nfserr;
234219
235220 dprintk("nfsd: CREATE(3) %s %.*s\n",
236221 SVCFH_fmt(&argp->fh),
....@@ -251,11 +236,10 @@
251236 }
252237
253238 /* Now create the file and set attributes */
254
- nfserr = do_nfsd_create(rqstp, dirfhp, argp->name, argp->len,
255
- attr, newfhp,
256
- argp->createmode, (u32 *)argp->verf, NULL, NULL);
257
-
258
- RETURN_STATUS(nfserr);
239
+ resp->status = do_nfsd_create(rqstp, dirfhp, argp->name, argp->len,
240
+ attr, newfhp, argp->createmode,
241
+ (u32 *)argp->verf, NULL, NULL);
242
+ return rpc_success;
259243 }
260244
261245 /*
....@@ -266,7 +250,6 @@
266250 {
267251 struct nfsd3_createargs *argp = rqstp->rq_argp;
268252 struct nfsd3_diropres *resp = rqstp->rq_resp;
269
- __be32 nfserr;
270253
271254 dprintk("nfsd: MKDIR(3) %s %.*s\n",
272255 SVCFH_fmt(&argp->fh),
....@@ -276,10 +259,10 @@
276259 argp->attrs.ia_valid &= ~ATTR_SIZE;
277260 fh_copy(&resp->dirfh, &argp->fh);
278261 fh_init(&resp->fh, NFS3_FHSIZE);
279
- nfserr = nfsd_create(rqstp, &resp->dirfh, argp->name, argp->len,
280
- &argp->attrs, S_IFDIR, 0, &resp->fh);
262
+ resp->status = nfsd_create(rqstp, &resp->dirfh, argp->name, argp->len,
263
+ &argp->attrs, S_IFDIR, 0, &resp->fh);
281264 fh_unlock(&resp->dirfh);
282
- RETURN_STATUS(nfserr);
265
+ return rpc_success;
283266 }
284267
285268 static __be32
....@@ -287,18 +270,23 @@
287270 {
288271 struct nfsd3_symlinkargs *argp = rqstp->rq_argp;
289272 struct nfsd3_diropres *resp = rqstp->rq_resp;
290
- __be32 nfserr;
291273
292
- if (argp->tlen == 0)
293
- RETURN_STATUS(nfserr_inval);
294
- if (argp->tlen > NFS3_MAXPATHLEN)
295
- RETURN_STATUS(nfserr_nametoolong);
274
+ if (argp->tlen == 0) {
275
+ resp->status = nfserr_inval;
276
+ goto out;
277
+ }
278
+ if (argp->tlen > NFS3_MAXPATHLEN) {
279
+ resp->status = nfserr_nametoolong;
280
+ goto out;
281
+ }
296282
297283 argp->tname = svc_fill_symlink_pathname(rqstp, &argp->first,
298284 page_address(rqstp->rq_arg.pages[0]),
299285 argp->tlen);
300
- if (IS_ERR(argp->tname))
301
- RETURN_STATUS(nfserrno(PTR_ERR(argp->tname)));
286
+ if (IS_ERR(argp->tname)) {
287
+ resp->status = nfserrno(PTR_ERR(argp->tname));
288
+ goto out;
289
+ }
302290
303291 dprintk("nfsd: SYMLINK(3) %s %.*s -> %.*s\n",
304292 SVCFH_fmt(&argp->ffh),
....@@ -307,10 +295,11 @@
307295
308296 fh_copy(&resp->dirfh, &argp->ffh);
309297 fh_init(&resp->fh, NFS3_FHSIZE);
310
- nfserr = nfsd_symlink(rqstp, &resp->dirfh, argp->fname, argp->flen,
311
- argp->tname, &resp->fh);
298
+ resp->status = nfsd_symlink(rqstp, &resp->dirfh, argp->fname,
299
+ argp->flen, argp->tname, &resp->fh);
312300 kfree(argp->tname);
313
- RETURN_STATUS(nfserr);
301
+out:
302
+ return rpc_success;
314303 }
315304
316305 /*
....@@ -321,7 +310,6 @@
321310 {
322311 struct nfsd3_mknodargs *argp = rqstp->rq_argp;
323312 struct nfsd3_diropres *resp = rqstp->rq_resp;
324
- __be32 nfserr;
325313 int type;
326314 dev_t rdev = 0;
327315
....@@ -333,22 +321,24 @@
333321 fh_copy(&resp->dirfh, &argp->fh);
334322 fh_init(&resp->fh, NFS3_FHSIZE);
335323
336
- if (argp->ftype == 0 || argp->ftype >= NF3BAD)
337
- RETURN_STATUS(nfserr_inval);
338324 if (argp->ftype == NF3CHR || argp->ftype == NF3BLK) {
339325 rdev = MKDEV(argp->major, argp->minor);
340326 if (MAJOR(rdev) != argp->major ||
341
- MINOR(rdev) != argp->minor)
342
- RETURN_STATUS(nfserr_inval);
343
- } else
344
- if (argp->ftype != NF3SOCK && argp->ftype != NF3FIFO)
345
- RETURN_STATUS(nfserr_inval);
327
+ MINOR(rdev) != argp->minor) {
328
+ resp->status = nfserr_inval;
329
+ goto out;
330
+ }
331
+ } else if (argp->ftype != NF3SOCK && argp->ftype != NF3FIFO) {
332
+ resp->status = nfserr_badtype;
333
+ goto out;
334
+ }
346335
347336 type = nfs3_ftypes[argp->ftype];
348
- nfserr = nfsd_create(rqstp, &resp->dirfh, argp->name, argp->len,
349
- &argp->attrs, type, rdev, &resp->fh);
337
+ resp->status = nfsd_create(rqstp, &resp->dirfh, argp->name, argp->len,
338
+ &argp->attrs, type, rdev, &resp->fh);
350339 fh_unlock(&resp->dirfh);
351
- RETURN_STATUS(nfserr);
340
+out:
341
+ return rpc_success;
352342 }
353343
354344 /*
....@@ -359,7 +349,6 @@
359349 {
360350 struct nfsd3_diropargs *argp = rqstp->rq_argp;
361351 struct nfsd3_attrstat *resp = rqstp->rq_resp;
362
- __be32 nfserr;
363352
364353 dprintk("nfsd: REMOVE(3) %s %.*s\n",
365354 SVCFH_fmt(&argp->fh),
....@@ -368,9 +357,10 @@
368357
369358 /* Unlink. -S_IFDIR means file must not be a directory */
370359 fh_copy(&resp->fh, &argp->fh);
371
- nfserr = nfsd_unlink(rqstp, &resp->fh, -S_IFDIR, argp->name, argp->len);
360
+ resp->status = nfsd_unlink(rqstp, &resp->fh, -S_IFDIR,
361
+ argp->name, argp->len);
372362 fh_unlock(&resp->fh);
373
- RETURN_STATUS(nfserr);
363
+ return rpc_success;
374364 }
375365
376366 /*
....@@ -381,7 +371,6 @@
381371 {
382372 struct nfsd3_diropargs *argp = rqstp->rq_argp;
383373 struct nfsd3_attrstat *resp = rqstp->rq_resp;
384
- __be32 nfserr;
385374
386375 dprintk("nfsd: RMDIR(3) %s %.*s\n",
387376 SVCFH_fmt(&argp->fh),
....@@ -389,9 +378,10 @@
389378 argp->name);
390379
391380 fh_copy(&resp->fh, &argp->fh);
392
- nfserr = nfsd_unlink(rqstp, &resp->fh, S_IFDIR, argp->name, argp->len);
381
+ resp->status = nfsd_unlink(rqstp, &resp->fh, S_IFDIR,
382
+ argp->name, argp->len);
393383 fh_unlock(&resp->fh);
394
- RETURN_STATUS(nfserr);
384
+ return rpc_success;
395385 }
396386
397387 static __be32
....@@ -399,7 +389,6 @@
399389 {
400390 struct nfsd3_renameargs *argp = rqstp->rq_argp;
401391 struct nfsd3_renameres *resp = rqstp->rq_resp;
402
- __be32 nfserr;
403392
404393 dprintk("nfsd: RENAME(3) %s %.*s ->\n",
405394 SVCFH_fmt(&argp->ffh),
....@@ -412,9 +401,9 @@
412401
413402 fh_copy(&resp->ffh, &argp->ffh);
414403 fh_copy(&resp->tfh, &argp->tfh);
415
- nfserr = nfsd_rename(rqstp, &resp->ffh, argp->fname, argp->flen,
416
- &resp->tfh, argp->tname, argp->tlen);
417
- RETURN_STATUS(nfserr);
404
+ resp->status = nfsd_rename(rqstp, &resp->ffh, argp->fname, argp->flen,
405
+ &resp->tfh, argp->tname, argp->tlen);
406
+ return rpc_success;
418407 }
419408
420409 static __be32
....@@ -422,7 +411,6 @@
422411 {
423412 struct nfsd3_linkargs *argp = rqstp->rq_argp;
424413 struct nfsd3_linkres *resp = rqstp->rq_resp;
425
- __be32 nfserr;
426414
427415 dprintk("nfsd: LINK(3) %s ->\n",
428416 SVCFH_fmt(&argp->ffh));
....@@ -433,9 +421,9 @@
433421
434422 fh_copy(&resp->fh, &argp->ffh);
435423 fh_copy(&resp->tfh, &argp->tfh);
436
- nfserr = nfsd_link(rqstp, &resp->tfh, argp->tname, argp->tlen,
437
- &resp->fh);
438
- RETURN_STATUS(nfserr);
424
+ resp->status = nfsd_link(rqstp, &resp->tfh, argp->tname, argp->tlen,
425
+ &resp->fh);
426
+ return rpc_success;
439427 }
440428
441429 /*
....@@ -446,8 +434,9 @@
446434 {
447435 struct nfsd3_readdirargs *argp = rqstp->rq_argp;
448436 struct nfsd3_readdirres *resp = rqstp->rq_resp;
449
- __be32 nfserr;
450
- int count;
437
+ int count = 0;
438
+ struct page **p;
439
+ caddr_t page_addr = NULL;
451440
452441 dprintk("nfsd: READDIR(3) %s %d bytes at %d\n",
453442 SVCFH_fmt(&argp->fh),
....@@ -464,10 +453,21 @@
464453 resp->common.err = nfs_ok;
465454 resp->buffer = argp->buffer;
466455 resp->rqstp = rqstp;
467
- nfserr = nfsd_readdir(rqstp, &resp->fh, (loff_t*) &argp->cookie,
468
- &resp->common, nfs3svc_encode_entry);
456
+ resp->status = nfsd_readdir(rqstp, &resp->fh, (loff_t *)&argp->cookie,
457
+ &resp->common, nfs3svc_encode_entry);
469458 memcpy(resp->verf, argp->verf, 8);
470
- resp->count = resp->buffer - argp->buffer;
459
+ count = 0;
460
+ for (p = rqstp->rq_respages + 1; p < rqstp->rq_next_page; p++) {
461
+ page_addr = page_address(*p);
462
+
463
+ if (((caddr_t)resp->buffer >= page_addr) &&
464
+ ((caddr_t)resp->buffer < page_addr + PAGE_SIZE)) {
465
+ count += (caddr_t)resp->buffer - page_addr;
466
+ break;
467
+ }
468
+ count += PAGE_SIZE;
469
+ }
470
+ resp->count = count >> 2;
471471 if (resp->offset) {
472472 loff_t offset = argp->cookie;
473473
....@@ -482,7 +482,7 @@
482482 resp->offset = NULL;
483483 }
484484
485
- RETURN_STATUS(nfserr);
485
+ return rpc_success;
486486 }
487487
488488 /*
....@@ -494,7 +494,6 @@
494494 {
495495 struct nfsd3_readdirargs *argp = rqstp->rq_argp;
496496 struct nfsd3_readdirres *resp = rqstp->rq_resp;
497
- __be32 nfserr;
498497 int count = 0;
499498 loff_t offset;
500499 struct page **p;
....@@ -517,17 +516,17 @@
517516 resp->rqstp = rqstp;
518517 offset = argp->cookie;
519518
520
- nfserr = fh_verify(rqstp, &resp->fh, S_IFDIR, NFSD_MAY_NOP);
521
- if (nfserr)
522
- RETURN_STATUS(nfserr);
519
+ resp->status = fh_verify(rqstp, &resp->fh, S_IFDIR, NFSD_MAY_NOP);
520
+ if (resp->status != nfs_ok)
521
+ goto out;
523522
524
- if (resp->fh.fh_export->ex_flags & NFSEXP_NOREADDIRPLUS)
525
- RETURN_STATUS(nfserr_notsupp);
523
+ if (resp->fh.fh_export->ex_flags & NFSEXP_NOREADDIRPLUS) {
524
+ resp->status = nfserr_notsupp;
525
+ goto out;
526
+ }
526527
527
- nfserr = nfsd_readdir(rqstp, &resp->fh,
528
- &offset,
529
- &resp->common,
530
- nfs3svc_encode_entry_plus);
528
+ resp->status = nfsd_readdir(rqstp, &resp->fh, &offset,
529
+ &resp->common, nfs3svc_encode_entry_plus);
531530 memcpy(resp->verf, argp->verf, 8);
532531 for (p = rqstp->rq_respages + 1; p < rqstp->rq_next_page; p++) {
533532 page_addr = page_address(*p);
....@@ -552,7 +551,8 @@
552551 resp->offset = NULL;
553552 }
554553
555
- RETURN_STATUS(nfserr);
554
+out:
555
+ return rpc_success;
556556 }
557557
558558 /*
....@@ -563,14 +563,13 @@
563563 {
564564 struct nfsd_fhandle *argp = rqstp->rq_argp;
565565 struct nfsd3_fsstatres *resp = rqstp->rq_resp;
566
- __be32 nfserr;
567566
568567 dprintk("nfsd: FSSTAT(3) %s\n",
569568 SVCFH_fmt(&argp->fh));
570569
571
- nfserr = nfsd_statfs(rqstp, &argp->fh, &resp->stats, 0);
570
+ resp->status = nfsd_statfs(rqstp, &argp->fh, &resp->stats, 0);
572571 fh_put(&argp->fh);
573
- RETURN_STATUS(nfserr);
572
+ return rpc_success;
574573 }
575574
576575 /*
....@@ -581,7 +580,6 @@
581580 {
582581 struct nfsd_fhandle *argp = rqstp->rq_argp;
583582 struct nfsd3_fsinfores *resp = rqstp->rq_resp;
584
- __be32 nfserr;
585583 u32 max_blocksize = svc_max_payload(rqstp);
586584
587585 dprintk("nfsd: FSINFO(3) %s\n",
....@@ -593,17 +591,17 @@
593591 resp->f_wtmax = max_blocksize;
594592 resp->f_wtpref = max_blocksize;
595593 resp->f_wtmult = PAGE_SIZE;
596
- resp->f_dtpref = PAGE_SIZE;
594
+ resp->f_dtpref = max_blocksize;
597595 resp->f_maxfilesize = ~(u32) 0;
598596 resp->f_properties = NFS3_FSF_DEFAULT;
599597
600
- nfserr = fh_verify(rqstp, &argp->fh, 0,
601
- NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
598
+ resp->status = fh_verify(rqstp, &argp->fh, 0,
599
+ NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
602600
603601 /* Check special features of the file system. May request
604602 * different read/write sizes for file systems known to have
605603 * problems with large blocks */
606
- if (nfserr == 0) {
604
+ if (resp->status == nfs_ok) {
607605 struct super_block *sb = argp->fh.fh_dentry->d_sb;
608606
609607 /* Note that we don't care for remote fs's here */
....@@ -614,7 +612,7 @@
614612 }
615613
616614 fh_put(&argp->fh);
617
- RETURN_STATUS(nfserr);
615
+ return rpc_success;
618616 }
619617
620618 /*
....@@ -625,7 +623,6 @@
625623 {
626624 struct nfsd_fhandle *argp = rqstp->rq_argp;
627625 struct nfsd3_pathconfres *resp = rqstp->rq_resp;
628
- __be32 nfserr;
629626
630627 dprintk("nfsd: PATHCONF(3) %s\n",
631628 SVCFH_fmt(&argp->fh));
....@@ -638,9 +635,9 @@
638635 resp->p_case_insensitive = 0;
639636 resp->p_case_preserving = 1;
640637
641
- nfserr = fh_verify(rqstp, &argp->fh, 0, NFSD_MAY_NOP);
638
+ resp->status = fh_verify(rqstp, &argp->fh, 0, NFSD_MAY_NOP);
642639
643
- if (nfserr == 0) {
640
+ if (resp->status == nfs_ok) {
644641 struct super_block *sb = argp->fh.fh_dentry->d_sb;
645642
646643 /* Note that we don't care for remote fs's here */
....@@ -657,9 +654,8 @@
657654 }
658655
659656 fh_put(&argp->fh);
660
- RETURN_STATUS(nfserr);
657
+ return rpc_success;
661658 }
662
-
663659
664660 /*
665661 * Commit a file (range) to stable storage.
....@@ -669,20 +665,22 @@
669665 {
670666 struct nfsd3_commitargs *argp = rqstp->rq_argp;
671667 struct nfsd3_commitres *resp = rqstp->rq_resp;
672
- __be32 nfserr;
673668
674669 dprintk("nfsd: COMMIT(3) %s %u@%Lu\n",
675670 SVCFH_fmt(&argp->fh),
676671 argp->count,
677672 (unsigned long long) argp->offset);
678673
679
- if (argp->offset > NFS_OFFSET_MAX)
680
- RETURN_STATUS(nfserr_inval);
674
+ if (argp->offset > NFS_OFFSET_MAX) {
675
+ resp->status = nfserr_inval;
676
+ goto out;
677
+ }
681678
682679 fh_copy(&resp->fh, &argp->fh);
683
- nfserr = nfsd_commit(rqstp, &resp->fh, argp->offset, argp->count);
684
-
685
- RETURN_STATUS(nfserr);
680
+ resp->status = nfsd_commit(rqstp, &resp->fh, argp->offset,
681
+ argp->count, resp->verf);
682
+out:
683
+ return rpc_success;
686684 }
687685
688686
....@@ -712,6 +710,7 @@
712710 static const struct svc_procedure nfsd_procedures3[22] = {
713711 [NFS3PROC_NULL] = {
714712 .pc_func = nfsd3_proc_null,
713
+ .pc_decode = nfs3svc_decode_voidarg,
715714 .pc_encode = nfs3svc_encode_voidres,
716715 .pc_argsize = sizeof(struct nfsd3_voidargs),
717716 .pc_ressize = sizeof(struct nfsd3_voidres),