lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120608185008.GC8030@soda.linbit>
Date:	Fri, 8 Jun 2012 20:50:08 +0200
From:	Lars Ellenberg <lars.ellenberg@...bit.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	Lars Ellenberg <drbd-dev@...ts.linbit.com>,
	kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
	drbd-user@...ts.linbit.com
Subject: Re: [DRBD-user] [patch -resend] drbd: fix resync_dump_detail() output

On Fri, Jun 08, 2012 at 03:31:28PM +0300, Dan Carpenter wrote:
> The tests here aren't correct.  It should be doing a shift before doing
> the bitwise AND.  (bme->flags & BME_NO_WRITES) is always false and
> (bme->flags & BME_LOCKED) checks for BME_NO_WRITES instead of checking
> for locked.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

Ack.

> ---
> I sent this to the drbd-user list in March, but never recieved a
> response.

Sorry, seems to have been lost :-(

	Lars

> diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_proc.c
> index 2959cdf..ffe1ee4 100644
> --- a/drivers/block/drbd/drbd_proc.c
> +++ b/drivers/block/drbd/drbd_proc.c
> @@ -187,8 +187,10 @@ static void resync_dump_detail(struct seq_file *seq, struct lc_element *e)
>  	struct bm_extent *bme = lc_entry(e, struct bm_extent, lce);
>  
>  	seq_printf(seq, "%5d %s %s\n", bme->rs_left,
> -		   bme->flags & BME_NO_WRITES ? "NO_WRITES" : "---------",
> -		   bme->flags & BME_LOCKED ? "LOCKED" : "------"
> +		   test_bit(BME_NO_WRITES, &bme->flags) ?
> +			"NO_WRITES" : "---------",
> +		   test_bit(BME_LOCKED, &bme->flags) ?
> +			"LOCKED" : "------"
>  		   );
>  }

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ