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

Commit 2d4dce00 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull NFS client updates from Trond Myklebust:
 "Features include:

   - Full audit of BUG_ON asserts in the NFS, SUNRPC and lockd client
     code.  Remove altogether where possible, and replace with
     WARN_ON_ONCE and appropriate error returns where not.
   - NFSv4.1 client adds session dynamic slot table management.  There
     is matching server side code that has been submitted to Bruce for
     consideration.

     Together, this code allows the server to dynamically manage the
     amount of memory it allocates to the duplicate request cache for
     each client.  It will constantly resize those caches to reserve
     more memory for clients that are hot while shrinking caches for
     those that are quiescent.

  In addition, there are assorted bugfixes for the generic NFS write
  code, fixes to deal with the drop_nlink() warnings, and yet another
  fix for NFSv4 getacl."

* tag 'nfs-for-3.8-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (106 commits)
  SUNRPC: continue run over clients list on PipeFS event instead of break
  NFS: Don't use SetPageError in the NFS writeback code
  SUNRPC: variable 'svsk' is unused in function bc_send_request
  SUNRPC: Handle ECONNREFUSED in xs_local_setup_socket
  NFSv4.1: Deal effectively with interrupted RPC calls.
  NFSv4.1: Move the RPC timestamp out of the slot.
  NFSv4.1: Try to deal with NFS4ERR_SEQ_MISORDERED.
  NFS: nfs_lookup_revalidate should not trust an inode with i_nlink == 0
  NFS: Fix calls to drop_nlink()
  NFS: Ensure that we always drop inodes that have been marked as stale
  nfs: Remove unused list nfs4_clientid_list
  nfs: Remove duplicate function declaration in internal.h
  NFS: avoid NULL dereference in nfs_destroy_server
  SUNRPC handle EKEYEXPIRED in call_refreshresult
  SUNRPC set gss gc_expiry to full lifetime
  nfs: fix page dirtying in NFS DIO read codepath
  nfs: don't zero out the rest of the page if we hit the EOF on a DIO READ
  NFSv4.1: Be conservative about the client highest slotid
  NFSv4.1: Handle NFS4ERR_BADSLOT errors correctly
  nfs: don't extend writes to cover entire page if pagecache is invalid
  ...
parents ea88eeac cd6c5968
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -64,10 +64,6 @@ static void nlm4_compute_offsets(const struct nlm_lock *lock,
{
	const struct file_lock *fl = &lock->fl;

	BUG_ON(fl->fl_start > NLM4_OFFSET_MAX);
	BUG_ON(fl->fl_end > NLM4_OFFSET_MAX &&
				fl->fl_end != OFFSET_MAX);

	*l_offset = loff_t_to_s64(fl->fl_start);
	if (fl->fl_end == OFFSET_MAX)
		*l_len = 0;
@@ -122,7 +118,6 @@ static void encode_netobj(struct xdr_stream *xdr,
{
	__be32 *p;

	BUG_ON(length > XDR_MAX_NETOBJ);
	p = xdr_reserve_space(xdr, 4 + length);
	xdr_encode_opaque(p, data, length);
}
@@ -156,7 +151,6 @@ static int decode_netobj(struct xdr_stream *xdr,
static void encode_cookie(struct xdr_stream *xdr,
			  const struct nlm_cookie *cookie)
{
	BUG_ON(cookie->len > NLM_MAXCOOKIELEN);
	encode_netobj(xdr, (u8 *)&cookie->data, cookie->len);
}

@@ -198,7 +192,6 @@ static int decode_cookie(struct xdr_stream *xdr,
 */
static void encode_fh(struct xdr_stream *xdr, const struct nfs_fh *fh)
{
	BUG_ON(fh->size > NFS3_FHSIZE);
	encode_netobj(xdr, (u8 *)&fh->data, fh->size);
}

@@ -336,7 +329,6 @@ static void encode_caller_name(struct xdr_stream *xdr, const char *name)
	u32 length = strlen(name);
	__be32 *p;

	BUG_ON(length > NLM_MAXSTRLEN);
	p = xdr_reserve_space(xdr, 4 + length);
	xdr_encode_opaque(p, name, length);
}
+1 −2
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)

static void nlmclnt_release_lockargs(struct nlm_rqst *req)
{
	BUG_ON(req->a_args.lock.fl.fl_ops != NULL);
	WARN_ON_ONCE(req->a_args.lock.fl.fl_ops != NULL);
}

/**
@@ -465,7 +465,6 @@ static const struct file_lock_operations nlmclnt_lock_ops = {

static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host)
{
	BUG_ON(fl->fl_ops != NULL);
	fl->fl_u.nfs_fl.state = 0;
	fl->fl_u.nfs_fl.owner = nlm_find_lockowner(host, fl->fl_owner);
	INIT_LIST_HEAD(&fl->fl_u.nfs_fl.list);
+0 −8
Original line number Diff line number Diff line
@@ -60,10 +60,6 @@ static void nlm_compute_offsets(const struct nlm_lock *lock,
{
	const struct file_lock *fl = &lock->fl;

	BUG_ON(fl->fl_start > NLM_OFFSET_MAX);
	BUG_ON(fl->fl_end > NLM_OFFSET_MAX &&
				fl->fl_end != OFFSET_MAX);

	*l_offset = loff_t_to_s32(fl->fl_start);
	if (fl->fl_end == OFFSET_MAX)
		*l_len = 0;
@@ -119,7 +115,6 @@ static void encode_netobj(struct xdr_stream *xdr,
{
	__be32 *p;

	BUG_ON(length > XDR_MAX_NETOBJ);
	p = xdr_reserve_space(xdr, 4 + length);
	xdr_encode_opaque(p, data, length);
}
@@ -153,7 +148,6 @@ static int decode_netobj(struct xdr_stream *xdr,
static void encode_cookie(struct xdr_stream *xdr,
			  const struct nlm_cookie *cookie)
{
	BUG_ON(cookie->len > NLM_MAXCOOKIELEN);
	encode_netobj(xdr, (u8 *)&cookie->data, cookie->len);
}

@@ -195,7 +189,6 @@ static int decode_cookie(struct xdr_stream *xdr,
 */
static void encode_fh(struct xdr_stream *xdr, const struct nfs_fh *fh)
{
	BUG_ON(fh->size != NFS2_FHSIZE);
	encode_netobj(xdr, (u8 *)&fh->data, NFS2_FHSIZE);
}

@@ -330,7 +323,6 @@ static void encode_caller_name(struct xdr_stream *xdr, const char *name)
	u32 length = strlen(name);
	__be32 *p;

	BUG_ON(length > NLM_MAXSTRLEN);
	p = xdr_reserve_space(xdr, 4 + length);
	xdr_encode_opaque(p, name, length);
}
+5 −10
Original line number Diff line number Diff line
@@ -177,9 +177,6 @@ static void nlm_destroy_host_locked(struct nlm_host *host)

	dprintk("lockd: destroy host %s\n", host->h_name);

	BUG_ON(!list_empty(&host->h_lockowners));
	BUG_ON(atomic_read(&host->h_count));

	hlist_del_init(&host->h_hash);

	nsm_unmonitor(host);
@@ -289,13 +286,12 @@ void nlmclnt_release_host(struct nlm_host *host)

	dprintk("lockd: release client host %s\n", host->h_name);

	BUG_ON(atomic_read(&host->h_count) < 0);
	BUG_ON(host->h_server);
	WARN_ON_ONCE(host->h_server);

	if (atomic_dec_and_test(&host->h_count)) {
		BUG_ON(!list_empty(&host->h_lockowners));
		BUG_ON(!list_empty(&host->h_granted));
		BUG_ON(!list_empty(&host->h_reclaim));
		WARN_ON_ONCE(!list_empty(&host->h_lockowners));
		WARN_ON_ONCE(!list_empty(&host->h_granted));
		WARN_ON_ONCE(!list_empty(&host->h_reclaim));

		mutex_lock(&nlm_host_mutex);
		nlm_destroy_host_locked(host);
@@ -412,8 +408,7 @@ void nlmsvc_release_host(struct nlm_host *host)

	dprintk("lockd: release server host %s\n", host->h_name);

	BUG_ON(atomic_read(&host->h_count) < 0);
	BUG_ON(!host->h_server);
	WARN_ON_ONCE(!host->h_server);
	atomic_dec(&host->h_count);
}

+0 −3
Original line number Diff line number Diff line
@@ -154,8 +154,6 @@ static int nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res,
		.rpc_resp	= res,
	};

	BUG_ON(clnt == NULL);

	memset(res, 0, sizeof(*res));

	msg.rpc_proc = &clnt->cl_procinfo[proc];
@@ -466,7 +464,6 @@ static void encode_nsm_string(struct xdr_stream *xdr, const char *string)
	const u32 len = strlen(string);
	__be32 *p;

	BUG_ON(len > SM_MAXSTRLEN);
	p = xdr_reserve_space(xdr, 4 + len);
	xdr_encode_opaque(p, string, len);
}
Loading