aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/vfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r--fs/nfsd/vfs.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 915808b36df7..16f0673a423c 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -404,6 +404,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
404 umode_t ftype = 0; 404 umode_t ftype = 0;
405 __be32 err; 405 __be32 err;
406 int host_err; 406 int host_err;
407 bool get_write_count;
407 int size_change = 0; 408 int size_change = 0;
408 409
409 if (iap->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_SIZE)) 410 if (iap->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_SIZE))
@@ -411,10 +412,18 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
411 if (iap->ia_valid & ATTR_SIZE) 412 if (iap->ia_valid & ATTR_SIZE)
412 ftype = S_IFREG; 413 ftype = S_IFREG;
413 414
415 /* Callers that do fh_verify should do the fh_want_write: */
416 get_write_count = !fhp->fh_dentry;
417
414 /* Get inode */ 418 /* Get inode */
415 err = fh_verify(rqstp, fhp, ftype, accmode); 419 err = fh_verify(rqstp, fhp, ftype, accmode);
416 if (err) 420 if (err)
417 goto out; 421 goto out;
422 if (get_write_count) {
423 host_err = fh_want_write(fhp);
424 if (host_err)
425 return nfserrno(host_err);
426 }
418 427
419 dentry = fhp->fh_dentry; 428 dentry = fhp->fh_dentry;
420 inode = dentry->d_inode; 429 inode = dentry->d_inode;
@@ -1706,10 +1715,10 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
1706 dput(odentry); 1715 dput(odentry);
1707 out_nfserr: 1716 out_nfserr:
1708 err = nfserrno(host_err); 1717 err = nfserrno(host_err);
1709 1718 /*
1710 /* we cannot reply on fh_unlock on the two filehandles, 1719 * We cannot rely on fh_unlock on the two filehandles,
1711 * as that would do the wrong thing if the two directories 1720 * as that would do the wrong thing if the two directories
1712 * were the same, so again we do it by hand 1721 * were the same, so again we do it by hand.
1713 */ 1722 */
1714 fill_post_wcc(ffhp); 1723 fill_post_wcc(ffhp);
1715 fill_post_wcc(tfhp); 1724 fill_post_wcc(tfhp);
#n627'>627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761
























































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
%PDF-1.4
%
3 0 obj <<
/Length 1720      
/Filter /FlateDecode
>>
stream
xXK6WV	Y3MP-Zt]K2H9ɡ^:^̑<ryՏx1q6&la,
4!!-KmW/QΏ )PJ$1͖G)ao4	SM-}R7K~
BT?J(ql_zn8
8R	?kxi04՗+,PAc=<j'EY@/UP,<3=
M]e+;Dmd<;A9k	t