Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1220990

Re: [PATCH 2/2] staging: lustre: lov: remove always false condition

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] staging: lustre: lov: remove always false condition
Date 2015-09-08 19:00 +0200
Message-ID <q6upt-1Fu-7@gated-at.bofh.it> (permalink)
References <q6tWq-16N-9@gated-at.bofh.it> <q6tWq-16N-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 2015-09-08 at 21:53 +0530, Sudip Mukherjee wrote:
> The member qc_idx of struct if_quotactl is unsigned and hence it can
> never be less than zero.
[]
> diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c
[]
> @@ -1487,7 +1487,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
>  		struct obd_quotactl *oqctl;
>  
>  		if (qctl->qc_valid == QC_OSTIDX) {
> -			if (qctl->qc_idx < 0 || count <= qctl->qc_idx)
> +			if (count <= qctl->qc_idx)

Perhaps this test would be clearer reversed too

			if (qctl->qc_idx >= count)

>  				return -EINVAL;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] staging: lustre: lov: remove always false condition Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-08 18:30 +0200
  Re: [PATCH 2/2] staging: lustre: lov: remove always false condition Joe Perches <joe@perches.com> - 2015-09-08 19:00 +0200
    Re: [PATCH 2/2] staging: lustre: lov: remove always false condition Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-08 19:50 +0200

csiph-web