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

Commit 92123e06 authored by Jeff Layton's avatar Jeff Layton Committed by Trond Myklebust
Browse files

rpc_pipefs: allow rpc_purge_list to take a NULL waitq pointer



In the event that we don't have a dentry for a rpc_pipefs pipe, we still
need to allow the queue_timeout job to clean out the queue. There's just
no waitq to wake up in that event.

Cc: stable@kernel.org
Reported-by: default avatarHans de Bruin <jmdebruin@xmsnet.nl>
Reported-by: default avatarJoerg Platte <jplatte@naasa.net>
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 2669940d
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -71,6 +71,8 @@ static void rpc_purge_list(wait_queue_head_t *waitq, struct list_head *head,
		msg->errno = err;
		msg->errno = err;
		destroy_msg(msg);
		destroy_msg(msg);
	} while (!list_empty(head));
	} while (!list_empty(head));

	if (waitq)
		wake_up(waitq);
		wake_up(waitq);
}
}


@@ -91,12 +93,10 @@ rpc_timeout_upcall_queue(struct work_struct *work)
	}
	}
	dentry = dget(pipe->dentry);
	dentry = dget(pipe->dentry);
	spin_unlock(&pipe->lock);
	spin_unlock(&pipe->lock);
	if (dentry) {
	rpc_purge_list(dentry ? &RPC_I(dentry->d_inode)->waitq : NULL,
		rpc_purge_list(&RPC_I(dentry->d_inode)->waitq,
			&free_list, destroy_msg, -ETIMEDOUT);
			&free_list, destroy_msg, -ETIMEDOUT);
	dput(dentry);
	dput(dentry);
}
}
}


ssize_t rpc_pipe_generic_upcall(struct file *filp, struct rpc_pipe_msg *msg,
ssize_t rpc_pipe_generic_upcall(struct file *filp, struct rpc_pipe_msg *msg,
				char __user *dst, size_t buflen)
				char __user *dst, size_t buflen)