| To: | axboe <axboe@xxxxxxxxx>, "konrad.wilk" <konrad.wilk@xxxxxxxxxx>, "chris.mason" <chris.mason@xxxxxxxxxxxx>, viro <viro@xxxxxxxxxxxxxxxxxx>, tytso <tytso@xxxxxxx>, "adilger.kernel" <adilger.kernel@xxxxxxxxx>, shaggy <shaggy@xxxxxxxxxx>, mfasheh <mfasheh@xxxxxxxx>, jlbec <jlbec@xxxxxxxxxxxx>, bpm <bpm@xxxxxxx>, elder <elder@xxxxxxxxxx> |
|---|---|
| Subject: | [PATCH 7/8]fs/ocfs2: Evalue bio->bi_rw after calling bio_alloc() and before calling bio_add_page(). |
| From: | majianpeng <majianpeng@xxxxxxxxx> |
| Date: | Mon, 30 Jul 2012 15:24:48 +0800 |
| Cc: | linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, linux-btrfs <linux-btrfs@xxxxxxxxxxxxxxx>, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, linux-ext4 <linux-ext4@xxxxxxxxxxxxxxx>, jfs-discussion <jfs-discussion@xxxxxxxxxxxxxxxxxxxxx>, xfs <xfs@xxxxxxxxxxx> |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:x-priority:x-has-attach:x-mailer :mime-version:message-id:content-type:content-transfer-encoding; bh=BTOv6JqdzC7sAHHKVNwLeS/uaAI16072+l20jS+YX90=; b=Vcs+O2stxkhssFMiRH0rulUscnGgdEf5Y9pblwashWl27uPSydG/X36I/rPmglpVav 5lot0bt1OyNYribmoIpsIwk4Lyc17L/s0wZrCL4yAkXSR+OnUOj7UVHSyAO8F+t5LIvI q8aC6bqxZGIOuZ1arP6PwOEqnFKRhl4nYru8BqV3LFIqeTjuPkiUHKLTfuTRFMNyD3Jt 9y83V5ScGsR4iDwFWHzHO4hlvhjrx7QNaDeneTzPqdLQsjnSXL5yvt9cStiQ6GaYDkmQ 2ezOVN7he3MPnbC4f8jBX3QHriNoaCdzokDYke1Sea8iIPRml34bCnBojzME6CLYy5R3 CKsA== |
Because call bio_alloc, the bi_rw is zero by default,but in
bio_add_page used the bi_rw. So evalue bi_rw.
Signed-off-by: Jianpeng Ma <majianpeng@xxxxxxxxx>
---
fs/ocfs2/cluster/heartbeat.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index a4e855e..50079d3 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -399,7 +399,8 @@ static void o2hb_bio_end_io(struct bio *bio,
static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg,
struct o2hb_bio_wait_ctxt *wc,
unsigned int *current_slot,
- unsigned int max_slots)
+ unsigned int max_slots,
+ int rw)
{
int len, current_page;
unsigned int vec_len, vec_start;
@@ -425,6 +426,7 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region
*reg,
bio->bi_bdev = reg->hr_bdev;
bio->bi_private = wc;
bio->bi_end_io = o2hb_bio_end_io;
+ bio->bi_rw = rw;
vec_start = (cs << bits) % PAGE_CACHE_SIZE;
while(cs < max_slots) {
@@ -460,7 +462,7 @@ static int o2hb_read_slots(struct o2hb_region *reg,
o2hb_bio_wait_init(&wc);
while(current_slot < max_slots) {
- bio = o2hb_setup_one_bio(reg, &wc, ¤t_slot, max_slots);
+ bio = o2hb_setup_one_bio(reg, &wc, ¤t_slot, max_slots,
READ);
if (IS_ERR(bio)) {
status = PTR_ERR(bio);
mlog_errno(status);
@@ -492,7 +494,7 @@ static int o2hb_issue_node_write(struct o2hb_region *reg,
slot = o2nm_this_node();
- bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1);
+ bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1, WRITE);
if (IS_ERR(bio)) {
status = PTR_ERR(bio);
mlog_errno(status);
--
1.7.9.5
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 8/8]fs/xfs: Evalue bio->bi_rw after calling bio_alloc() and before calling bio_add_page()., majianpeng |
|---|---|
| Next by Date: | [PATCH 1/1] xfs: check for possible overflow in xfs_ioc_trim, Tomas Racek |
| Previous by Thread: | [PATCH 8/8]fs/xfs: Evalue bio->bi_rw after calling bio_alloc() and before calling bio_add_page()., majianpeng |
| Next by Thread: | [PATCH 1/1] xfs: check for possible overflow in xfs_ioc_trim, Tomas Racek |
| Indexes: | [Date] [Thread] [Top] [All Lists] |