patch-2.0.1 linux/fs/nfs/proc.c

Next file: linux/fs/open.c
Previous file: linux/fs/nfs/nfsiod.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.0/linux/fs/nfs/proc.c linux/fs/nfs/proc.c
@@ -451,13 +451,12 @@
 	req->rq_addr = &server->toaddr;
 	req->rq_alen = sizeof(server->toaddr);
 
-	return 0;
+	return rpc_transmit(server->rsock, req);
 }
 
 int
-nfs_proc_read_reply(struct rpc_ioreq *req)
+nfs_proc_read_reply(struct rpc_ioreq *req, struct nfs_fattr *fattr)
 {
-	struct nfs_fattr fattr;
 	int		status;
 	__u32		*p0, *p;
 	int		count;
@@ -465,9 +464,11 @@
 	p0 = (__u32 *) req->rq_rvec[0].iov_base;
 
 	if (!(p = nfs_rpc_verify(p0))) {
-		status = -errno_NFSERR_IO;
+		/* Tell the upper layers to retry */
+		status = -EAGAIN;
+		/* status = -errno_NFSERR_IO; */
 	} else if ((status = ntohl(*p++)) == NFS_OK) {
-		p = xdr_decode_fattr(p, &fattr);
+		p = xdr_decode_fattr(p, fattr);
 		count = ntohl(*p++);
 		if (p != req->rq_rvec[2].iov_base) {
 			/* unexpected RPC reply header size. punt.
@@ -612,12 +613,19 @@
 
 int nfs_proc_rename(struct nfs_server *server,
 		    struct nfs_fh *old_dir, const char *old_name,
-		    struct nfs_fh *new_dir, const char *new_name)
+		    struct nfs_fh *new_dir, const char *new_name,
+		    int must_be_dir)
 {
 	int *p, *p0;
 	int status;
 	int ruid = 0;
 
+	/*
+	 * Disallow "rename()" with trailing slashes over NFS: getting
+	 * POSIX.1 behaviour is just too unlikely.
+	 */
+	if (must_be_dir)
+		return -EINVAL;
 	PRINTK("NFS call  rename %s -> %s\n", old_name, new_name);
 	if (!(p0 = nfs_rpc_alloc(server->wsize)))
 		return -EIO;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov