public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Jens Axboe <axboe@kernel.dk>, lkml <linux-kernel@vger.kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Neil Brown <neilb@suse.de>
Subject: [PATCH block#for-2.6.36-post] block: fix incorrect bio/request flag conversion in md
Date: Mon, 16 Aug 2010 16:21:25 +0200	[thread overview]
Message-ID: <4C694965.6040805@kernel.org> (raw)

Commit 74450be1 (block: unify flags for struct bio and struct request)
incorrectly converted @do_sync in md raid1 and raid10 make_requst()
functions.

@do_sync is now supposed to carry the actual flag bit and directly
OR'd into bio->bi_rw but is still a bool and thus carries either 0 or
1 instead of the actual flag bit.  This makes REQ_SYNC ignored on
writes and flips the direction of READ_SYNCs to WRITEs.

Fix it by making @do_sync unsigned integers.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Neil Brown <neilb@suse.de>
---
 drivers/md/raid1.c  |    2 +-
 drivers/md/raid10.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: block/drivers/md/raid1.c
===================================================================
--- block.orig/drivers/md/raid1.c
+++ block/drivers/md/raid1.c
@@ -787,7 +787,7 @@ static int make_request(mddev_t *mddev,
 	struct bio_list bl;
 	struct page **behind_pages = NULL;
 	const int rw = bio_data_dir(bio);
-	const bool do_sync = (bio->bi_rw & REQ_SYNC);
+	const unsigned int do_sync = (bio->bi_rw & REQ_SYNC);
 	bool do_barriers;
 	mdk_rdev_t *blocked_rdev;

Index: block/drivers/md/raid10.c
===================================================================
--- block.orig/drivers/md/raid10.c
+++ block/drivers/md/raid10.c
@@ -799,7 +799,7 @@ static int make_request(mddev_t *mddev,
 	int i;
 	int chunk_sects = conf->chunk_mask + 1;
 	const int rw = bio_data_dir(bio);
-	const bool do_sync = (bio->bi_rw & REQ_SYNC);
+	const unsigned int do_sync = (bio->bi_rw & REQ_SYNC);
 	struct bio_list bl;
 	unsigned long flags;
 	mdk_rdev_t *blocked_rdev;

             reply	other threads:[~2010-08-16 14:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16 14:21 Tejun Heo [this message]
2010-08-17 13:56 ` [PATCH block#for-2.6.36-post] block: fix incorrect bio/request flag conversion in md Christoph Hellwig
2010-08-17 13:56   ` Tejun Heo

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=4C694965.6040805@kernel.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    /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