diff options
-rw-r--r-- | fs/nfs/nfs3proc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 80378d1283cb..fabb4f2849a1 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -574,7 +574,7 @@ out: | |||
574 | static int | 574 | static int |
575 | nfs3_proc_rmdir(struct inode *dir, struct qstr *name) | 575 | nfs3_proc_rmdir(struct inode *dir, struct qstr *name) |
576 | { | 576 | { |
577 | struct nfs_fattr dir_attr; | 577 | struct nfs_fattr *dir_attr; |
578 | struct nfs3_diropargs arg = { | 578 | struct nfs3_diropargs arg = { |
579 | .fh = NFS_FH(dir), | 579 | .fh = NFS_FH(dir), |
580 | .name = name->name, | 580 | .name = name->name, |
@@ -583,14 +583,19 @@ nfs3_proc_rmdir(struct inode *dir, struct qstr *name) | |||
583 | struct rpc_message msg = { | 583 | struct rpc_message msg = { |
584 | .rpc_proc = &nfs3_procedures[NFS3PROC_RMDIR], | 584 | .rpc_proc = &nfs3_procedures[NFS3PROC_RMDIR], |
585 | .rpc_argp = &arg, | 585 | .rpc_argp = &arg, |
586 | .rpc_resp = &dir_attr, | ||
587 | }; | 586 | }; |
588 | int status; | 587 | int status = -ENOMEM; |
589 | 588 | ||
590 | dprintk("NFS call rmdir %s\n", name->name); | 589 | dprintk("NFS call rmdir %s\n", name->name); |
591 | nfs_fattr_init(&dir_attr); | 590 | dir_attr = nfs_alloc_fattr(); |
591 | if (dir_attr == NULL) | ||
592 | goto out; | ||
593 | |||
594 | msg.rpc_resp = dir_attr; | ||
592 | status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); | 595 | status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); |
593 | nfs_post_op_update_inode(dir, &dir_attr); | 596 | nfs_post_op_update_inode(dir, dir_attr); |
597 | nfs_free_fattr(dir_attr); | ||
598 | out: | ||
594 | dprintk("NFS reply rmdir: %d\n", status); | 599 | dprintk("NFS reply rmdir: %d\n", status); |
595 | return status; | 600 | return status; |
596 | } | 601 | } |