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.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index c8bd9c3be7f7..4700a0a929d7 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -745,7 +745,7 @@ __be32
745nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, 745nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
746 int may_flags, struct file **filp) 746 int may_flags, struct file **filp)
747{ 747{
748 struct dentry *dentry; 748 struct path path;
749 struct inode *inode; 749 struct inode *inode;
750 int flags = O_RDONLY|O_LARGEFILE; 750 int flags = O_RDONLY|O_LARGEFILE;
751 __be32 err; 751 __be32 err;
@@ -762,8 +762,9 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
762 if (err) 762 if (err)
763 goto out; 763 goto out;
764 764
765 dentry = fhp->fh_dentry; 765 path.mnt = fhp->fh_export->ex_path.mnt;
766 inode = dentry->d_inode; 766 path.dentry = fhp->fh_dentry;
767 inode = path.dentry->d_inode;
767 768
768 /* Disallow write access to files with the append-only bit set 769 /* Disallow write access to files with the append-only bit set
769 * or any access when mandatory locking enabled 770 * or any access when mandatory locking enabled
@@ -792,8 +793,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
792 else 793 else
793 flags = O_WRONLY|O_LARGEFILE; 794 flags = O_WRONLY|O_LARGEFILE;
794 } 795 }
795 *filp = dentry_open(dget(dentry), mntget(fhp->fh_export->ex_path.mnt), 796 *filp = dentry_open(&path, flags, current_cred());
796 flags, current_cred());
797 if (IS_ERR(*filp)) 797 if (IS_ERR(*filp))
798 host_err = PTR_ERR(*filp); 798 host_err = PTR_ERR(*filp);
799 else { 799 else {
@@ -1329,7 +1329,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
1329 err = 0; 1329 err = 0;
1330 switch (type) { 1330 switch (type) {
1331 case S_IFREG: 1331 case S_IFREG:
1332 host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL); 1332 host_err = vfs_create(dirp, dchild, iap->ia_mode, true);
1333 if (!host_err) 1333 if (!host_err)
1334 nfsd_check_ignore_resizing(iap); 1334 nfsd_check_ignore_resizing(iap);
1335 break; 1335 break;
@@ -1492,7 +1492,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
1492 goto out; 1492 goto out;
1493 } 1493 }
1494 1494
1495 host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL); 1495 host_err = vfs_create(dirp, dchild, iap->ia_mode, true);
1496 if (host_err < 0) { 1496 if (host_err < 0) {
1497 fh_drop_write(fhp); 1497 fh_drop_write(fhp);
1498 goto out_nfserr; 1498 goto out_nfserr;