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

Commit 060c2820 authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman
Browse files

staging: lustre: remove uses of IS_ERR_VALUE()



Remove most uses of IS_ERR_VALUE(). This macro was often given an int
argument coming from PTR_ERR(). This invokes implementation defined
behavior since the long value gotten by applying PTR_ERR() to a kernel
pointer will usually not be representable as an int. Moreover it may
be just plain wrong to do this since the expressions IS_ERR(p) and
IS_ERR_VALUE((int) PTR_ERR(p)) are not equivalent for a general
pointer p.

Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3498
Reviewed-on: http://review.whamcloud.com/6759


Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 764d2e9a
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -439,6 +439,7 @@ accept2secure(const char *acc, long *sec)
int
lnet_acceptor_start(void)
{
	struct task_struct *task;
	int rc;
	long rc2;
	long secure;
@@ -457,10 +458,10 @@ lnet_acceptor_start(void)
	if (!lnet_count_acceptor_nis())  /* not required */
		return 0;

	rc2 = PTR_ERR(kthread_run(lnet_acceptor,
				  (void *)(ulong_ptr_t)secure,
				  "acceptor_%03ld", secure));
	if (IS_ERR_VALUE(rc2)) {
	task = kthread_run(lnet_acceptor, (void *)(ulong_ptr_t)secure,
			   "acceptor_%03ld", secure);
	if (IS_ERR(task)) {
		rc2 = PTR_ERR(task);
		CERROR("Can't start acceptor thread: %ld\n", rc2);

		return -ESRCH;
+4 −3
Original line number Diff line number Diff line
@@ -1004,6 +1004,7 @@ lnet_ping_router_locked(lnet_peer_t *rtr)
int
lnet_router_checker_start(void)
{
	struct task_struct *task;
	int rc;
	int eqsz;

@@ -1034,9 +1035,9 @@ lnet_router_checker_start(void)
	}

	the_lnet.ln_rc_state = LNET_RC_STATE_RUNNING;
	rc = PTR_ERR(kthread_run(lnet_router_checker,
				 NULL, "router_checker"));
	if (IS_ERR_VALUE(rc)) {
	task = kthread_run(lnet_router_checker, NULL, "router_checker");
	if (IS_ERR(task)) {
		rc = PTR_ERR(task);
		CERROR("Can't start router checker thread: %d\n", rc);
		/* block until event callback signals exit */
		down(&the_lnet.ln_rc_signal);
+4 −2
Original line number Diff line number Diff line
@@ -1056,6 +1056,7 @@ static int tracefiled(void *arg)
int cfs_trace_start_thread(void)
{
	struct tracefiled_ctl *tctl = &trace_tctl;
	struct task_struct *task;
	int rc = 0;

	mutex_lock(&cfs_trace_thread_mutex);
@@ -1067,8 +1068,9 @@ int cfs_trace_start_thread(void)
	init_waitqueue_head(&tctl->tctl_waitq);
	atomic_set(&tctl->tctl_shutdown, 0);

	if (IS_ERR(kthread_run(tracefiled, tctl, "ktracefiled"))) {
		rc = -ECHILD;
	task = kthread_run(tracefiled, tctl, "ktracefiled");
	if (IS_ERR(task)) {
		rc = PTR_ERR(task);
		goto out;
	}

+5 −3
Original line number Diff line number Diff line
@@ -1498,6 +1498,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
	struct ll_sa_entry       *entry;
	struct ptlrpc_thread     *thread;
	struct l_wait_info	lwi   = { 0 };
	struct task_struct *task;
	int		       rc    = 0;
	struct ll_inode_info     *plli;

@@ -1656,10 +1657,11 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
	lli->lli_sai = sai;

	plli = ll_i2info(d_inode(parent));
	rc = PTR_ERR(kthread_run(ll_statahead_thread, parent,
				 "ll_sa_%u", plli->lli_opendir_pid));
	task = kthread_run(ll_statahead_thread, parent, "ll_sa_%u",
			   plli->lli_opendir_pid);
	thread = &sai->sai_thread;
	if (IS_ERR_VALUE(rc)) {
	if (IS_ERR(task)) {
		rc = PTR_ERR(task);
		CERROR("can't start ll_sa thread, rc: %d\n", rc);
		dput(parent);
		lli->lli_opendir_key = NULL;
+12 −6
Original line number Diff line number Diff line
@@ -1554,6 +1554,7 @@ static int mdc_ioc_changelog_send(struct obd_device *obd,
				  struct ioc_changelog *icc)
{
	struct changelog_show *cs;
	struct task_struct *task;
	int rc;

	/* Freed in mdc_changelog_send_thread */
@@ -1571,15 +1572,20 @@ static int mdc_ioc_changelog_send(struct obd_device *obd,
	 * New thread because we should return to user app before
	 * writing into our pipe
	 */
	rc = PTR_ERR(kthread_run(mdc_changelog_send_thread, cs,
				 "mdc_clg_send_thread"));
	if (!IS_ERR_VALUE(rc)) {
		CDEBUG(D_CHANGELOG, "start changelog thread\n");
		return 0;
	task = kthread_run(mdc_changelog_send_thread, cs,
			   "mdc_clg_send_thread");
	if (IS_ERR(task)) {
		rc = PTR_ERR(task);
		CERROR("%s: can't start changelog thread: rc = %d\n",
		       obd->obd_name, rc);
		kfree(cs);
	} else {
		rc = 0;
		CDEBUG(D_CHANGELOG, "%s: started changelog thread\n",
		       obd->obd_name);
	}

	CERROR("Failed to start changelog thread: %d\n", rc);
	kfree(cs);
	return rc;
}

Loading