Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b233b7c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-3.19' of git://linux-nfs.org/~bfields/linux

Pull nfsd updates from Bruce Fields:
 "A comparatively quieter cycle for nfsd this time, but still with two
  larger changes:

   - RPC server scalability improvements from Jeff Layton (using RCU
     instead of a spinlock to find idle threads).

   - server-side NFSv4.2 ALLOCATE/DEALLOCATE support from Anna
     Schumaker, enabling fallocate on new clients"

* 'for-3.19' of git://linux-nfs.org/~bfields/linux: (32 commits)
  nfsd4: fix xdr4 count of server in fs_location4
  nfsd4: fix xdr4 inclusion of escaped char
  sunrpc/cache: convert to use string_escape_str()
  sunrpc: only call test_bit once in svc_xprt_received
  fs: nfsd: Fix signedness bug in compare_blob
  sunrpc: add some tracepoints around enqueue and dequeue of svc_xprt
  sunrpc: convert to lockless lookup of queued server threads
  sunrpc: fix potential races in pool_stats collection
  sunrpc: add a rcu_head to svc_rqst and use kfree_rcu to free it
  sunrpc: require svc_create callers to pass in meaningful shutdown routine
  sunrpc: have svc_wake_up only deal with pool 0
  sunrpc: convert sp_task_pending flag to use atomic bitops
  sunrpc: move rq_cachetype field to better optimize space
  sunrpc: move rq_splice_ok flag into rq_flags
  sunrpc: move rq_dropme flag into rq_flags
  sunrpc: move rq_usedeferral flag to rq_flags
  sunrpc: move rq_local field to rq_flags
  sunrpc: add a generic rq_flags field to svc_rqst and move rq_secure to it
  nfsd: minor off by one checks in __write_versions()
  sunrpc: release svc_pool_map reference when serv allocation fails
  ...
parents 6f51ee70 bf7491f1
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -446,7 +446,7 @@ ashmem_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
		loff_t start = range->pgstart * PAGE_SIZE;
		loff_t start = range->pgstart * PAGE_SIZE;
		loff_t end = (range->pgend + 1) * PAGE_SIZE;
		loff_t end = (range->pgend + 1) * PAGE_SIZE;


		do_fallocate(range->asma->file,
		vfs_fallocate(range->asma->file,
				FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
				FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
				start, end - start);
				start, end - start);
		range->purged = ASHMEM_WAS_PURGED;
		range->purged = ASHMEM_WAS_PURGED;
+1 −1
Original line number Original line Diff line number Diff line
@@ -443,7 +443,7 @@ int ioctl_preallocate(struct file *filp, void __user *argp)
		return -EINVAL;
		return -EINVAL;
	}
	}


	return do_fallocate(filp, FALLOC_FL_KEEP_SIZE, sr.l_start, sr.l_len);
	return vfs_fallocate(filp, FALLOC_FL_KEEP_SIZE, sr.l_start, sr.l_len);
}
}


static int file_ioctl(struct file *filp, unsigned int cmd,
static int file_ioctl(struct file *filp, unsigned int cmd,
+1 −1
Original line number Original line Diff line number Diff line
@@ -214,7 +214,7 @@ int nsm_monitor(const struct nlm_host *host)
	if (unlikely(res.status != 0))
	if (unlikely(res.status != 0))
		status = -EIO;
		status = -EIO;
	if (unlikely(status < 0)) {
	if (unlikely(status < 0)) {
		printk(KERN_NOTICE "lockd: cannot monitor %s\n", nsm->sm_name);
		pr_notice_ratelimited("lockd: cannot monitor %s\n", nsm->sm_name);
		return status;
		return status;
	}
	}


+1 −1
Original line number Original line Diff line number Diff line
@@ -350,7 +350,7 @@ static struct svc_serv *lockd_create_svc(void)
		printk(KERN_WARNING
		printk(KERN_WARNING
			"lockd_up: no pid, %d users??\n", nlmsvc_users);
			"lockd_up: no pid, %d users??\n", nlmsvc_users);


	serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, NULL);
	serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, svc_rpcb_cleanup);
	if (!serv) {
	if (!serv) {
		printk(KERN_WARNING "lockd_up: create service failed\n");
		printk(KERN_WARNING "lockd_up: create service failed\n");
		return ERR_PTR(-ENOMEM);
		return ERR_PTR(-ENOMEM);
+54 −3
Original line number Original line Diff line number Diff line
@@ -33,6 +33,7 @@
 *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 */
#include <linux/file.h>
#include <linux/file.h>
#include <linux/falloc.h>
#include <linux/slab.h>
#include <linux/slab.h>


#include "idmap.h"
#include "idmap.h"
@@ -772,7 +773,7 @@ nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
	 * the client wants us to do more in this compound:
	 * the client wants us to do more in this compound:
	 */
	 */
	if (!nfsd4_last_compound_op(rqstp))
	if (!nfsd4_last_compound_op(rqstp))
		rqstp->rq_splice_ok = false;
		clear_bit(RQ_SPLICE_OK, &rqstp->rq_flags);


	/* check stateid */
	/* check stateid */
	if ((status = nfs4_preprocess_stateid_op(SVC_NET(rqstp),
	if ((status = nfs4_preprocess_stateid_op(SVC_NET(rqstp),
@@ -1013,6 +1014,44 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
	return status;
	return status;
}
}


static __be32
nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
		struct nfsd4_fallocate *fallocate, int flags)
{
	__be32 status = nfserr_notsupp;
	struct file *file;

	status = nfs4_preprocess_stateid_op(SVC_NET(rqstp), cstate,
					    &fallocate->falloc_stateid,
					    WR_STATE, &file);
	if (status != nfs_ok) {
		dprintk("NFSD: nfsd4_fallocate: couldn't process stateid!\n");
		return status;
	}

	status = nfsd4_vfs_fallocate(rqstp, &cstate->current_fh, file,
				     fallocate->falloc_offset,
				     fallocate->falloc_length,
				     flags);
	fput(file);
	return status;
}

static __be32
nfsd4_allocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
	       struct nfsd4_fallocate *fallocate)
{
	return nfsd4_fallocate(rqstp, cstate, fallocate, 0);
}

static __be32
nfsd4_deallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
		 struct nfsd4_fallocate *fallocate)
{
	return nfsd4_fallocate(rqstp, cstate, fallocate,
			       FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE);
}

static __be32
static __be32
nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
		struct nfsd4_seek *seek)
		struct nfsd4_seek *seek)
@@ -1331,7 +1370,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
	 * Don't use the deferral mechanism for NFSv4; compounds make it
	 * Don't use the deferral mechanism for NFSv4; compounds make it
	 * too hard to avoid non-idempotency problems.
	 * too hard to avoid non-idempotency problems.
	 */
	 */
	rqstp->rq_usedeferral = false;
	clear_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);


	/*
	/*
	 * According to RFC3010, this takes precedence over all other errors.
	 * According to RFC3010, this takes precedence over all other errors.
@@ -1447,7 +1486,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
	BUG_ON(cstate->replay_owner);
	BUG_ON(cstate->replay_owner);
out:
out:
	/* Reset deferral mechanism for RPC deferrals */
	/* Reset deferral mechanism for RPC deferrals */
	rqstp->rq_usedeferral = true;
	set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);
	dprintk("nfsv4 compound returned %d\n", ntohl(status));
	dprintk("nfsv4 compound returned %d\n", ntohl(status));
	return status;
	return status;
}
}
@@ -1929,6 +1968,18 @@ static struct nfsd4_operation nfsd4_ops[] = {
	},
	},


	/* NFSv4.2 operations */
	/* NFSv4.2 operations */
	[OP_ALLOCATE] = {
		.op_func = (nfsd4op_func)nfsd4_allocate,
		.op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
		.op_name = "OP_ALLOCATE",
		.op_rsize_bop = (nfsd4op_rsize)nfsd4_write_rsize,
	},
	[OP_DEALLOCATE] = {
		.op_func = (nfsd4op_func)nfsd4_deallocate,
		.op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
		.op_name = "OP_DEALLOCATE",
		.op_rsize_bop = (nfsd4op_rsize)nfsd4_write_rsize,
	},
	[OP_SEEK] = {
	[OP_SEEK] = {
		.op_func = (nfsd4op_func)nfsd4_seek,
		.op_func = (nfsd4op_func)nfsd4_seek,
		.op_name = "OP_SEEK",
		.op_name = "OP_SEEK",
Loading