FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ


Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 05-01-2008, 10:50 PM
Chandra Seetharaman
 
Default scsi_dh: Do not allow arguments for hardware handlers

Subject: [PATCH 06/10] scsi_dh: Do not allow arguments for hardware handlers

From: Chandra Seetharaman <sekharan@us.ibm.com>

The new implementation does not use the arguments provided with the
hardware handler. This patch makes the change visible to the user by
failing table load when arguments are provided with the hardware handler.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---
Index: linux-2.6.25/drivers/md/dm-mpath.c
================================================== =================
--- linux-2.6.25.orig/drivers/md/dm-mpath.c
+++ linux-2.6.25/drivers/md/dm-mpath.c
@@ -653,11 +653,15 @@ static int parse_hw_handler(struct arg_s
struct dm_target *ti = m->ti;

static struct param _params[] = {
- {0, 1024, "invalid number of hardware handler args"},
+ {0, 1, "invalid number of hardware handler args"},
};

- if (read_param(_params, shift(as), &hw_argc, &ti->error))
+ if (read_param(_params, shift(as), &hw_argc, &ti->error)) {
+ if (hw_argc > 1)
+ ti->error = "no arguments accepted for hardware"
+ " handler";
return -EINVAL;
+ }

if (!hw_argc)
return 0;

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 05-02-2008, 11:47 PM
Alasdair G Kergon
 
Default scsi_dh: Do not allow arguments for hardware handlers

On Thu, May 01, 2008 at 02:50:17PM -0700, Chandra Seetharaman wrote:
> Subject: [PATCH 06/10] scsi_dh: Do not allow arguments for hardware handlers
> From: Chandra Seetharaman <sekharan@us.ibm.com>
> The new implementation does not use the arguments provided with the
> hardware handler. This patch makes the change visible to the user by
> failing table load when arguments are provided with the hardware handler.

But then someone supplying such an arg may need to update their
userspace multipath config file before they can use this new kernel.

Past experience suggests that changes like that usually come back
and bite us. Let's instead just have the kernel log a message noting
that the args have been ignored and allow people to deal with it at
their leisure.

Alasdair
--
agk@redhat.com

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 05-03-2008, 01:01 AM
Chandra Seetharaman
 
Default scsi_dh: Do not allow arguments for hardware handlers

On Fri, 2008-05-02 at 23:47 +0100, Alasdair G Kergon wrote:
> On Thu, May 01, 2008 at 02:50:17PM -0700, Chandra Seetharaman wrote:
> > Subject: [PATCH 06/10] scsi_dh: Do not allow arguments for hardware handlers
> > From: Chandra Seetharaman <sekharan@us.ibm.com>
> > The new implementation does not use the arguments provided with the
> > hardware handler. This patch makes the change visible to the user by
> > failing table load when arguments are provided with the hardware handler.
>
> But then someone supplying such an arg may need to update their
> userspace multipath config file before they can use this new kernel.
>
> Past experience suggests that changes like that usually come back
> and bite us. Let's instead just have the kernel log a message noting
> that the args have been ignored and allow people to deal with it at
> their leisure.

Understand.

How does the following patch look ?
--------------------
Subject: [PATCH 06/10] scsi_dh: Print warning when arguments were provided for hardware handlers

From: Chandra Seetharaman <sekharan@us.ibm.com>

The new implementation does not use the arguments provided with the
hardware handler. This patch makes the change visible to the user by
printing a warning to the kernel log.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---
Index: linux-2.6.25/drivers/md/dm-mpath.c
================================================== =================
--- linux-2.6.25.orig/drivers/md/dm-mpath.c
+++ linux-2.6.25/drivers/md/dm-mpath.c
@@ -656,8 +656,11 @@ static int parse_hw_handler(struct arg_s
{0, 1024, "invalid number of hardware handler args"},
};

- if (read_param(_params, shift(as), &hw_argc, &ti->error))
- return -EINVAL;
+ if (read_param(_params, shift(as), &hw_argc, &ti->error)) {
+ if (hw_argc > 1)
+ printk(KERN_WARN "Additional arguments provided to "
+ "hardware handler were ignored
");
+ }

if (!hw_argc)
return 0;
------------------------
>
> Alasdair

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 10:57 PM.

VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org