diff options
Diffstat (limited to 'fs/nfs')
| -rw-r--r-- | fs/nfs/Kconfig | 1 | ||||
| -rw-r--r-- | fs/nfs/client.c | 2 | ||||
| -rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.c | 5 | ||||
| -rw-r--r-- | fs/nfs/inode.c | 10 | ||||
| -rw-r--r-- | fs/nfs/internal.h | 2 | ||||
| -rw-r--r-- | fs/nfs/nfs42proc.c | 3 | ||||
| -rw-r--r-- | fs/nfs/nfs4file.c | 4 | ||||
| -rw-r--r-- | fs/nfs/nfs4proc.c | 5 | ||||
| -rw-r--r-- | fs/nfs/nfs4super.c | 2 | ||||
| -rw-r--r-- | fs/nfs/nfs4xdr.c | 4 | ||||
| -rw-r--r-- | fs/nfs/super.c | 5 | 
11 files changed, 19 insertions, 24 deletions
| diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig index 5f93cfacb3d1..69d02cf8cf37 100644 --- a/fs/nfs/Kconfig +++ b/fs/nfs/Kconfig @@ -121,7 +121,6 @@ config PNFS_FILE_LAYOUT  config PNFS_BLOCK  	tristate  	depends on NFS_V4_1 && BLK_DEV_DM -	depends on 64BIT || LBDAF  	default NFS_V4  config PNFS_FLEXFILE_LAYOUT diff --git a/fs/nfs/client.c b/fs/nfs/client.c index fb1cf1a4bda2..90d71fda65ce 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -453,7 +453,7 @@ void nfs_init_timeout_values(struct rpc_timeout *to, int proto,  	case XPRT_TRANSPORT_RDMA:  		if (retrans == NFS_UNSPEC_RETRANS)  			to->to_retries = NFS_DEF_TCP_RETRANS; -		if (timeo == NFS_UNSPEC_TIMEO || to->to_retries == 0) +		if (timeo == NFS_UNSPEC_TIMEO || to->to_initval == 0)  			to->to_initval = NFS_DEF_TCP_TIMEO * HZ / 10;  		if (to->to_initval > NFS_MAX_TCP_TIMEOUT)  			to->to_initval = NFS_MAX_TCP_TIMEOUT; diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index f9264e1922a2..6673d4ff5a2a 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -1289,6 +1289,7 @@ static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg,  static int ff_layout_read_done_cb(struct rpc_task *task,  				struct nfs_pgio_header *hdr)  { +	int new_idx = hdr->pgio_mirror_idx;  	int err;  	trace_nfs4_pnfs_read(hdr, task->tk_status); @@ -1307,7 +1308,7 @@ static int ff_layout_read_done_cb(struct rpc_task *task,  	case -NFS4ERR_RESET_TO_PNFS:  		if (ff_layout_choose_best_ds_for_read(hdr->lseg,  					hdr->pgio_mirror_idx + 1, -					&hdr->pgio_mirror_idx)) +					&new_idx))  			goto out_layouterror;  		set_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags);  		return task->tk_status; @@ -1320,7 +1321,9 @@ static int ff_layout_read_done_cb(struct rpc_task *task,  	return 0;  out_layouterror: +	ff_layout_read_record_layoutstats_done(task, hdr);  	ff_layout_send_layouterror(hdr->lseg); +	hdr->pgio_mirror_idx = new_idx;  out_eagain:  	rpc_restart_call_prepare(task);  	return -EAGAIN; diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 414a90d48493..f61af8307dc8 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -2055,17 +2055,11 @@ struct inode *nfs_alloc_inode(struct super_block *sb)  }  EXPORT_SYMBOL_GPL(nfs_alloc_inode); -static void nfs_i_callback(struct rcu_head *head) +void nfs_free_inode(struct inode *inode)  { -	struct inode *inode = container_of(head, struct inode, i_rcu);  	kmem_cache_free(nfs_inode_cachep, NFS_I(inode));  } - -void nfs_destroy_inode(struct inode *inode) -{ -	call_rcu(&inode->i_rcu, nfs_i_callback); -} -EXPORT_SYMBOL_GPL(nfs_destroy_inode); +EXPORT_SYMBOL_GPL(nfs_free_inode);  static inline void nfs4_init_once(struct nfs_inode *nfsi)  { diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index c7cf23ae6597..331a0504eaf8 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -381,7 +381,7 @@ int nfs_check_flags(int);  /* inode.c */  extern struct workqueue_struct *nfsiod_workqueue;  extern struct inode *nfs_alloc_inode(struct super_block *sb); -extern void nfs_destroy_inode(struct inode *); +extern void nfs_free_inode(struct inode *);  extern int nfs_write_inode(struct inode *, struct writeback_control *);  extern int nfs_drop_inode(struct inode *);  extern void nfs_clear_inode(struct inode *); diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index ff6f85fb676b..5196bfa7894d 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -329,9 +329,6 @@ ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src,  	};  	ssize_t err, err2; -	if (!nfs_server_capable(file_inode(dst), NFS_CAP_COPY)) -		return -EOPNOTSUPP; -  	src_lock = nfs_get_lock_context(nfs_file_open_context(src));  	if (IS_ERR(src_lock))  		return PTR_ERR(src_lock); diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index 45b2322e092d..00d17198ee12 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c @@ -133,8 +133,10 @@ static ssize_t nfs4_copy_file_range(struct file *file_in, loff_t pos_in,  				    struct file *file_out, loff_t pos_out,  				    size_t count, unsigned int flags)  { +	if (!nfs_server_capable(file_inode(file_out), NFS_CAP_COPY)) +		return -EOPNOTSUPP;  	if (file_inode(file_in) == file_inode(file_out)) -		return -EINVAL; +		return -EOPNOTSUPP;  	return nfs42_proc_copy(file_in, pos_in, file_out, pos_out, count);  } diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 4dbb0ee23432..741ff8c9c6ed 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2933,7 +2933,8 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,  	}  out: -	nfs4_sequence_free_slot(&opendata->o_res.seq_res); +	if (!opendata->cancelled) +		nfs4_sequence_free_slot(&opendata->o_res.seq_res);  	return ret;  } @@ -6301,7 +6302,6 @@ static struct nfs4_unlockdata *nfs4_alloc_unlockdata(struct file_lock *fl,  	p->arg.seqid = seqid;  	p->res.seqid = seqid;  	p->lsp = lsp; -	refcount_inc(&lsp->ls_count);  	/* Ensure we don't close file until we're done freeing locks! */  	p->ctx = get_nfs_open_context(ctx);  	p->l_ctx = nfs_get_lock_context(ctx); @@ -6526,7 +6526,6 @@ static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl,  	p->res.lock_seqid = p->arg.lock_seqid;  	p->lsp = lsp;  	p->server = server; -	refcount_inc(&lsp->ls_count);  	p->ctx = get_nfs_open_context(ctx);  	locks_init_lock(&p->fl);  	locks_copy_lock(&p->fl, fl); diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index 6fb7cb6b3f4b..689977e148cb 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -50,7 +50,7 @@ struct file_system_type nfs4_referral_fs_type = {  static const struct super_operations nfs4_sops = {  	.alloc_inode	= nfs_alloc_inode, -	.destroy_inode	= nfs_destroy_inode, +	.free_inode	= nfs_free_inode,  	.write_inode	= nfs4_write_inode,  	.drop_inode	= nfs_drop_inode,  	.statfs		= nfs_statfs, diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index cfcabc33e24d..602446158bfb 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -2589,7 +2589,7 @@ static void nfs4_xdr_enc_getacl(struct rpc_rqst *req, struct xdr_stream *xdr,  			ARRAY_SIZE(nfs4_acl_bitmap), &hdr);  	rpc_prepare_reply_pages(req, args->acl_pages, 0, -				args->acl_len, replen); +				args->acl_len, replen + 1);  	encode_nops(&hdr);  } @@ -2811,7 +2811,7 @@ static void nfs4_xdr_enc_fs_locations(struct rpc_rqst *req,  	}  	rpc_prepare_reply_pages(req, (struct page **)&args->page, 0, -				PAGE_SIZE, replen); +				PAGE_SIZE, replen + 1);  	encode_nops(&hdr);  } diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 23790c7b2289..450ae77d19bf 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -309,7 +309,7 @@ struct file_system_type nfs_xdev_fs_type = {  const struct super_operations nfs_sops = {  	.alloc_inode	= nfs_alloc_inode, -	.destroy_inode	= nfs_destroy_inode, +	.free_inode	= nfs_free_inode,  	.write_inode	= nfs_write_inode,  	.drop_inode	= nfs_drop_inode,  	.statfs		= nfs_statfs, @@ -2041,7 +2041,8 @@ static int nfs23_validate_mount_data(void *options,  		memcpy(sap, &data->addr, sizeof(data->addr));  		args->nfs_server.addrlen = sizeof(data->addr);  		args->nfs_server.port = ntohs(data->addr.sin_port); -		if (!nfs_verify_server_address(sap)) +		if (sap->sa_family != AF_INET || +		    !nfs_verify_server_address(sap))  			goto out_no_address;  		if (!(data->flags & NFS_MOUNT_TCP)) |