linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] make device mapper compile on 2.5.4x
@ 2002-11-11 22:53 Bernd Eckenfels
  2002-11-11 23:23 ` Alexander Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Bernd Eckenfels @ 2002-11-11 22:53 UTC (permalink / raw)
  To: dm, linux-lvm; +Cc: linux-kernel

Hello,

device mapper does not compile on my 2.4.x tree, because of an argument
incompatibility in set_device_ro(). Please find attached a patch, which
makes this file compile. I am not sure if it is correct, since I do not
unterstand whats going on here, and have not tested it yet. Please somebody
have a look at it since it it broken for multiple releases, yet.

BTW: I also suggest to remove the www.sistina.com/lvm/ url from the
MAINTAINER file since it does not contain any useful information anymore.

Greetings
Bernd

--- drivers/md/dm-ioctl.c~	2002-11-11 23:27:38.000000000 +0100
+++ drivers/md/dm-ioctl.c	2002-11-11 23:43:41.000000000 +0100
@@ -560,6 +560,7 @@
 	struct dm_table *t;
 	struct mapped_device *md;
 	int minor;
+	struct block_device *bdev;
 
 	r = check_name(param->name);
 	if (r)
@@ -585,7 +586,12 @@
 	}
 	dm_table_put(t);	/* md will have grabbed its own reference */
 
-	set_device_ro(dm_kdev(md), 0/*(param->flags & DM_READONLY_FLAG)*/);
+	bdev = bdget(kdev_t_to_nr(dm_kdev(md)));
+	if (!bdev)
+		return -ENXIO;
+	set_device_ro(bdev, (param->flags & DM_READONLY_FLAG));
+	bdput(bdev);
+
 	r = dm_hash_insert(param->name, *param->uuid ? param->uuid : NULL, md);
 	dm_put(md);
 
@@ -847,6 +853,7 @@
 	int r;
 	struct mapped_device *md;
 	struct dm_table *t;
+	struct block_device *bdev;
 
 	r = dm_table_create(&t, get_mode(param));
 	if (r)
@@ -871,7 +878,12 @@
 		return r;
 	}
 
-	set_device_ro(dm_kdev(md), (param->flags & DM_READONLY_FLAG));
+	bdev = bdget(kdev_t_to_nr(dm_kdev(md)));
+	if (!bdev)
+		return -ENXIO;
+	set_device_ro(bdev, (param->flags & DM_READONLY_FLAG));
+	bdput(bdev);
+
 	dm_put(md);
 
 	r = info(param, user);


-- 
  (OO)      -- Bernd_Eckenfels@Wendelinusstrasse39.76646Bruchsal.de --
 ( .. )  ecki@{inka.de,linux.de,debian.org} http://home.pages.de/~eckes/
  o--o     *plush*  2048/93600EFD  eckes@irc  +497257930613  BE5-RIPE
(O____O)  When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] make device mapper compile on 2.5.4x
  2002-11-11 22:53 [patch] make device mapper compile on 2.5.4x Bernd Eckenfels
@ 2002-11-11 23:23 ` Alexander Viro
  2002-11-12  8:58   ` [linux-lvm] " Joe Thornber
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Viro @ 2002-11-11 23:23 UTC (permalink / raw)
  To: Bernd Eckenfels; +Cc: dm, linux-lvm, linux-kernel



On Mon, 11 Nov 2002, Bernd Eckenfels wrote:

> -	set_device_ro(dm_kdev(md), 0/*(param->flags & DM_READONLY_FLAG)*/);
> +	bdev = bdget(kdev_t_to_nr(dm_kdev(md)));
> +	if (!bdev)
> +		return -ENXIO;
> +	set_device_ro(bdev, (param->flags & DM_READONLY_FLAG));
> +	bdput(bdev);

That is simply wrong.  set_device_ro() works only on opened block_device.
Correct fix is to use set_disk_ro() and it's already in the tree (1.830
on bkbits).


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Re: [patch] make device mapper compile on 2.5.4x
  2002-11-11 23:23 ` Alexander Viro
@ 2002-11-12  8:58   ` Joe Thornber
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Thornber @ 2002-11-12  8:58 UTC (permalink / raw)
  To: linux-lvm; +Cc: Bernd Eckenfels, dm, linux-kernel

On Mon, Nov 11, 2002 at 06:23:00PM -0500, Alexander Viro wrote:
> 
> 
> On Mon, 11 Nov 2002, Bernd Eckenfels wrote:
> 
> > -	set_device_ro(dm_kdev(md), 0/*(param->flags & DM_READONLY_FLAG)*/);
> > +	bdev = bdget(kdev_t_to_nr(dm_kdev(md)));
> > +	if (!bdev)
> > +		return -ENXIO;
> > +	set_device_ro(bdev, (param->flags & DM_READONLY_FLAG));
> > +	bdput(bdev);
> 
> That is simply wrong.  set_device_ro() works only on opened block_device.
> Correct fix is to use set_disk_ro() and it's already in the tree (1.830
> on bkbits).

And I have sent the patch for this 3 times now.

- Joe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-11-12  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-11 22:53 [patch] make device mapper compile on 2.5.4x Bernd Eckenfels
2002-11-11 23:23 ` Alexander Viro
2002-11-12  8:58   ` [linux-lvm] " Joe Thornber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).