Commit 2831fa8b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull nfsd updates from Chuck Lever:
 "Neil Brown and Jeff Layton contributed a dynamic thread pool sizing
  mechanism for NFSD. The sunrpc layer now tracks minimum and maximum
  thread counts per pool, and NFSD adjusts running thread counts based
  on workload: idle threads exit after a timeout when the pool exceeds
  its minimum, and new threads spawn automatically when all threads are
  busy. Administrators control this behavior via the nfsdctl netlink
  interface.

  Rick Macklem, FreeBSD NFS maintainer, generously contributed server-
  side support for the POSIX ACL extension to NFSv4, as specified in
  draft-ietf-nfsv4-posix-acls. This extension allows NFSv4 clients to
  get and set POSIX access and default ACLs using native NFSv4
  operations, eliminating the need for sideband protocols. The feature
  is gated by a Kconfig option since the IETF draft has not yet been
  ratified.

  Chuck Lever delivered numerous improvements to the xdrgen tool. Error
  reporting now covers parsing, AST transformation, and invalid
  declarations. Generated enum decoders validate incoming values against
  valid enumerator lists. New features include pass-through line support
  for embedding C directives in XDR specifications, 16-bit integer
  types, and program number definitions. Several code generation issues
  were also addressed.

  When an administrator revokes NFSv4 state for a filesystem via the
  unlock_fs interface, ongoing async COPY operations referencing that
  filesystem are now cancelled, with CB_OFFLOAD callbacks notifying
  affected clients.

  The remaining patches in this pull request are clean-ups and minor
  optimizations. Sincere thanks to all contributors, reviewers, testers,
  and bug reporters who participated in the v7.0 NFSD development cycle"

* tag 'nfsd-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (45 commits)
  NFSD: Add POSIX ACL file attributes to SUPPATTR bitmasks
  NFSD: Add POSIX draft ACL support to the NFSv4 SETATTR operation
  NFSD: Add support for POSIX draft ACLs for file creation
  NFSD: Add support for XDR decoding POSIX draft ACLs
  NFSD: Refactor nfsd_setattr()'s ACL error reporting
  NFSD: Do not allow NFSv4 (N)VERIFY to check POSIX ACL attributes
  NFSD: Add nfsd4_encode_fattr4_posix_access_acl
  NFSD: Add nfsd4_encode_fattr4_posix_default_acl
  NFSD: Add nfsd4_encode_fattr4_acl_trueform_scope
  NFSD: Add nfsd4_encode_fattr4_acl_trueform
  Add RPC language definition of NFSv4 POSIX ACL extension
  NFSD: Add a Kconfig setting to enable support for NFSv4 POSIX ACLs
  xdrgen: Implement pass-through lines in specifications
  nfsd: cancel async COPY operations when admin revokes filesystem state
  nfsd: add controls to set the minimum number of threads per pool
  nfsd: adjust number of running nfsd threads based on activity
  sunrpc: allow svc_recv() to return -ETIMEDOUT and -EBUSY
  sunrpc: split new thread creation into a separate function
  sunrpc: introduce the concept of a minimum number of threads per pool
  sunrpc: track the max number of requested threads in a pool
  ...
parents 37a93dd5 e939bd67
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -78,6 +78,9 @@ attribute-sets:
      -
        name: scope
        type: string
      -
        name: min-threads
        type: u32
  -
    name: version
    attributes:
@@ -159,6 +162,7 @@ operations:
            - gracetime
            - leasetime
            - scope
            - min-threads
    -
      name: threads-get
      doc: get the number of running threads
@@ -170,6 +174,7 @@ operations:
            - gracetime
            - leasetime
            - scope
            - min-threads
    -
      name: version-set
      doc: set nfs enabled versions
+61 −0
Original line number Diff line number Diff line
@@ -53,6 +53,11 @@ typedef unsigned int uint32_t;
 */
typedef uint32_t	bitmap4<>;

typedef opaque		utf8string<>;
typedef utf8string	utf8str_cis;
typedef utf8string	utf8str_cs;
typedef utf8string	utf8str_mixed;

/*
 * Timeval
 */
@@ -184,3 +189,59 @@ enum open_delegation_type4 {
       OPEN_DELEGATE_READ_ATTRS_DELEG      = 4,
       OPEN_DELEGATE_WRITE_ATTRS_DELEG     = 5
};


/*
 * The following content was extracted from draft-ietf-nfsv4-posix-acls
 */

enum aclmodel4 {
	ACL_MODEL_NFS4		= 1,
	ACL_MODEL_POSIX_DRAFT	= 2,
	ACL_MODEL_NONE		= 3
};
pragma public aclmodel4;

enum aclscope4 {
	ACL_SCOPE_FILE_OBJECT	= 1,
	ACL_SCOPE_FILE_SYSTEM	= 2,
	ACL_SCOPE_SERVER	= 3
};
pragma public aclscope4;

enum posixacetag4 {
	POSIXACE4_TAG_USER_OBJ	= 1,
	POSIXACE4_TAG_USER	= 2,
	POSIXACE4_TAG_GROUP_OBJ	= 3,
	POSIXACE4_TAG_GROUP	= 4,
	POSIXACE4_TAG_MASK	= 5,
	POSIXACE4_TAG_OTHER	= 6
};
pragma public posixacetag4;

typedef uint32_t	posixaceperm4;
pragma public posixaceperm4;

/* Bit definitions for posixaceperm4. */
const POSIXACE4_PERM_EXECUTE	= 0x00000001;
const POSIXACE4_PERM_WRITE	= 0x00000002;
const POSIXACE4_PERM_READ	= 0x00000004;

struct posixace4 {
	posixacetag4		tag;
	posixaceperm4		perm;
	utf8str_mixed		who;
};

typedef aclmodel4	fattr4_acl_trueform;
typedef aclscope4	fattr4_acl_trueform_scope;
typedef posixace4	fattr4_posix_default_acl<>;
typedef posixace4	fattr4_posix_access_acl<>;

%/*
% * New for POSIX ACL extension
% */
const FATTR4_ACL_TRUEFORM	= 89;
const FATTR4_ACL_TRUEFORM_SCOPE	= 90;
const FATTR4_POSIX_DEFAULT_ACL	= 91;
const FATTR4_POSIX_ACCESS_ACL	= 92;
+3 −3
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ lockd(void *vrqstp)
	 */
	while (!svc_thread_should_stop(rqstp)) {
		nlmsvc_retry_blocked(rqstp);
		svc_recv(rqstp);
		svc_recv(rqstp, 0);
	}
	if (nlmsvc_ops)
		nlmsvc_invalidate_all();
@@ -340,7 +340,7 @@ static int lockd_get(void)
		return -ENOMEM;
	}

	error = svc_set_num_threads(serv, NULL, 1);
	error = svc_set_num_threads(serv, 0, 1);
	if (error < 0) {
		svc_destroy(&serv);
		return error;
@@ -368,7 +368,7 @@ static void lockd_put(void)
	unregister_inet6addr_notifier(&lockd_inet6addr_notifier);
#endif

	svc_set_num_threads(nlmsvc_serv, NULL, 0);
	svc_set_num_threads(nlmsvc_serv, 0, 0);
	timer_delete_sync(&nlmsvc_retry);
	svc_destroy(&nlmsvc_serv);
	dprintk("lockd_down: service destroyed\n");
+0 −4
Original line number Diff line number Diff line
@@ -641,10 +641,6 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
	conflock->fl.c.flc_owner = lock->fl.c.flc_owner;
	error = vfs_test_lock(file->f_file[mode], &conflock->fl);
	if (error) {
		/* We can't currently deal with deferred test requests */
		if (error == FILE_LOCK_DEFERRED)
			WARN_ON_ONCE(1);

		ret = nlm_lck_denied_nolocks;
		goto out;
	}
+14 −3
Original line number Diff line number Diff line
@@ -2262,12 +2262,23 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
 */
int vfs_test_lock(struct file *filp, struct file_lock *fl)
{
	int error = 0;

	WARN_ON_ONCE(fl->fl_ops || fl->fl_lmops);
	WARN_ON_ONCE(filp != fl->c.flc_file);
	if (filp->f_op->lock)
		return filp->f_op->lock(filp, F_GETLK, fl);
		error = filp->f_op->lock(filp, F_GETLK, fl);
	else
		posix_test_lock(filp, fl);
	return 0;

	/*
	 * We don't expect FILE_LOCK_DEFERRED and callers cannot
	 * handle it.
	 */
	if (WARN_ON_ONCE(error == FILE_LOCK_DEFERRED))
		error = -EIO;

	return error;
}
EXPORT_SYMBOL_GPL(vfs_test_lock);

Loading