Linux LVM users
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolabs.com>
To: Linux LVM mailing list <linux-lvm@msede.com>
Cc: linux-raid@vger.rutgers.edu
Subject: [linux-lvm] using LVM on top of mingo raid
Date: Tue, 27 Jun 2000 14:02:15 -0600 (MDT)	[thread overview]
Message-ID: <200006272002.e5RK2FR13447@webber.adilger.net> (raw)

Hello,
I'm trying to get LVM 0.8 on top of Ingo's 0.9 RAID patches with 2.2.16
(this appears to be the same issue as applying LVM on top of a RedHat
kernel, which came up on the LVM list a few times, but was never answered).

There is a problem with applying the LVM patch to ll_rw_block.c, which
I think I have fixed, but I'm not very certain of the RAID code, so I'd
like some comments on these changes:

2.2.16+LVM looks like :::: drivers/block/ll_rw_blk.c ::::::::::
============================================================================
#ifdef CONFIG_BLK_DEV_MD
                if (major==MD_MAJOR &&
                    /* changed             v   to allow LVM to remap */
                    md_map (MINOR(bh[i]->b_rdev), &bh[i]->b_rdev,
                            &bh[i]->b_rsector, bh[i]->b_size >> 9)) {
                        printk (KERN_ERR
                                "Bad md_map in ll_rw_block\n");
                        goto sorry;
                }
#endif
 [[[[snip]]]]
			/* changed         v  to allow LVM to remap */
                        if (MAJOR(bh[i]->b_rdev) == MD_MAJOR) {
                                /* changed for LVM to remap     v */
                                md_make_request(MINOR (bh[i]->b_rdev), rw, bh[i]);
                                continue; 
                        } 
============================================================================
2.2.16+RAID0.9+LVM looks like this :::: drivers/block/ll_rw_blk.c ::::::::::
============================================================================
#ifdef CONFIG_BLK_DEV_MD
                if (major==MD_MAJOR &&
-                   md_map (bh[i]->b_dev, &bh[i]->b_rdev,
+                   /* changed       v   to allow LVM to remap */
+                   md_map (bh[i]->b_rdev, &bh[i]->b_rdev,
                            &bh[i]->b_rsector, bh[i]->b_size >> 9)) {
                        printk (KERN_ERR
                                "Bad md_map in ll_rw_block\n");
                        goto sorry;
                }
#endif
 [[[[snip]]]]
-                        if (MAJOR(bh[i]->b_dev) == MD_MAJOR) {
+                        /* changed         v  to allow LVM to remap */
+                        if (MAJOR(bh[i]->b_rdev) == MD_MAJOR) {
                                md_make_request(bh[i], rw);
                                continue; 
                        } 

 :::::::: in drivers/block/md.c ::::::::::
static int md_make_request()
{
-	mddev_t *mddev = kdev_to_mddev(bh->b_dev);
+       /* changed                           v to allow LVM to remap */
+	mddev_t *mddev = kdev_to_mddev(bh->b_rdev);
============================================================================

The md_make_request() uses the same mddev (i.e. uses b_rdev instead of b_dev)
in 2.4-test1, so I think this is correct.  I'm not certain of md_map()
because it no longer exists in 2.4.  The change looks like it would work
(going from old to new RAID), but I have no idea as I've never set up RAID
before so there could be any number of problems...

Cheers, Andreas

PS - I'm not on the linux-raid list, so please CC any replies to me or
     linux-lvm@msede.com
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

             reply	other threads:[~2000-06-27 20:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-27 20:02 Andreas Dilger [this message]
2000-06-27 22:08 ` [linux-lvm] using LVM on top of mingo raid Daniel Mehrmann

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=200006272002.e5RK2FR13447@webber.adilger.net \
    --to=adilger@turbolabs.com \
    --cc=linux-lvm@msede.com \
    --cc=linux-raid@vger.rutgers.edu \
    /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