All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: neilb@cse.unsw.edu.au
Cc: linux-raid@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Pete Zaitcev <zaitcev@redhat.com>
Subject: Bug in RAID1 in 2.4
Date: Sat, 20 Dec 2003 03:25:47 -0500	[thread overview]
Message-ID: <20031220082547.GB18118@devserv.devel.redhat.com> (raw)

In drivers/md/raid1.c, raid1_sync_request contains the following:
  
        block_nr = sector_nr;
        bsize = 512;
        while (!(block_nr & 1) && bsize < PAGE_SIZE
                        && (block_nr+2)*(bsize>>9) < (mddev->sb->size *2)) {
                block_nr >>= 1;
                bsize <<= 1;
        }

Suppose that a mirror is 4K in size. The code above produces
reads (and writes) of the following offsets and sizes:
 0K[2K], 2K[1K], 3K[0.5K], 3.5K[0.5K]

The above is correct, but it makes the RAID1 completely unuseable
on s390, because I/O with sizes less than 4K is not supported.
I would like the attached patch applied to correct the issue.

-- Pete

--- linux-2.4.23/drivers/md/raid1.c	2003-06-13 07:51:34.000000000 -0700
+++ linux-2.4.23-nip/drivers/md/raid1.c	2003-12-19 23:57:57.000000000 -0800
@@ -1436,7 +1436,7 @@
 	block_nr = sector_nr;
 	bsize = 512;
 	while (!(block_nr & 1) && bsize < PAGE_SIZE
-			&& (block_nr+2)*(bsize>>9) < (mddev->sb->size *2)) {
+			&& (block_nr+2)*(bsize>>9) <= (mddev->sb->size *2)) {
 		block_nr >>= 1;
 		bsize <<= 1;
 	}

             reply	other threads:[~2003-12-20  8:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-20  8:25 Pete Zaitcev [this message]
2003-12-21  9:44 ` Bug in RAID1 in 2.4 Neil Brown

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=20031220082547.GB18118@devserv.devel.redhat.com \
    --to=zaitcev@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=neilb@cse.unsw.edu.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.