From: Dan Carpenter <dan.carpenter@oracle.com>
To: Lars Ellenberg <drbd-dev@lists.linbit.com>
Cc: drbd-user@lists.linbit.com, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [patch -resend] drbd: fix resync_dump_detail() output
Date: Fri, 8 Jun 2012 15:31:28 +0300 [thread overview]
Message-ID: <20120608123128.GA18293@elgon.mountain> (raw)
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@oracle.com>
---
I sent this to the drbd-user list in March, but never recieved a
response.
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" : "------"
);
}
next reply other threads:[~2012-06-08 12:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-08 12:31 Dan Carpenter [this message]
2012-06-08 18:50 ` [DRBD-user] [patch -resend] drbd: fix resync_dump_detail() output Lars Ellenberg
2014-02-17 19:43 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120608123128.GA18293@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=drbd-dev@lists.linbit.com \
--cc=drbd-user@lists.linbit.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox