aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/nfs4proc.c8
-rw-r--r--fs/nfsd/vfs.c10
2 files changed, 13 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 87d24e5f3ca4..1a0b1fdb5ad3 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -195,6 +195,7 @@ static __be32
195do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open) 195do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
196{ 196{
197 struct svc_fh *resfh; 197 struct svc_fh *resfh;
198 int accmode;
198 __be32 status; 199 __be32 status;
199 200
200 resfh = kmalloc(sizeof(struct svc_fh), GFP_KERNEL); 201 resfh = kmalloc(sizeof(struct svc_fh), GFP_KERNEL);
@@ -254,9 +255,10 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
254 /* set reply cache */ 255 /* set reply cache */
255 fh_copy_shallow(&open->op_openowner->oo_owner.so_replay.rp_openfh, 256 fh_copy_shallow(&open->op_openowner->oo_owner.so_replay.rp_openfh,
256 &resfh->fh_handle); 257 &resfh->fh_handle);
257 if (!open->op_created) 258 accmode = NFSD_MAY_NOP;
258 status = do_open_permission(rqstp, resfh, open, 259 if (open->op_created)
259 NFSD_MAY_NOP); 260 accmode |= NFSD_MAY_OWNER_OVERRIDE;
261 status = do_open_permission(rqstp, resfh, open, accmode);
260 set_change_info(&open->op_cinfo, current_fh); 262 set_change_info(&open->op_cinfo, current_fh);
261 fh_dup2(current_fh, resfh); 263 fh_dup2(current_fh, resfh);
262out: 264out:
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index b584205b25b4..0ef9b6b410a2 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1471,13 +1471,19 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
1471 case NFS3_CREATE_EXCLUSIVE: 1471 case NFS3_CREATE_EXCLUSIVE:
1472 if ( dchild->d_inode->i_mtime.tv_sec == v_mtime 1472 if ( dchild->d_inode->i_mtime.tv_sec == v_mtime
1473 && dchild->d_inode->i_atime.tv_sec == v_atime 1473 && dchild->d_inode->i_atime.tv_sec == v_atime
1474 && dchild->d_inode->i_size == 0 ) 1474 && dchild->d_inode->i_size == 0 ) {
1475 if (created)
1476 *created = 1;
1475 break; 1477 break;
1478 }
1476 case NFS4_CREATE_EXCLUSIVE4_1: 1479 case NFS4_CREATE_EXCLUSIVE4_1:
1477 if ( dchild->d_inode->i_mtime.tv_sec == v_mtime 1480 if ( dchild->d_inode->i_mtime.tv_sec == v_mtime
1478 && dchild->d_inode->i_atime.tv_sec == v_atime 1481 && dchild->d_inode->i_atime.tv_sec == v_atime
1479 && dchild->d_inode->i_size == 0 ) 1482 && dchild->d_inode->i_size == 0 ) {
1483 if (created)
1484 *created = 1;
1480 goto set_attr; 1485 goto set_attr;
1486 }
1481 /* fallthru */ 1487 /* fallthru */
1482 case NFS3_CREATE_GUARDED: 1488 case NFS3_CREATE_GUARDED:
1483 err = nfserr_exist; 1489 err = nfserr_exist;