linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] cmdfilter: clean up sysfs interface
@ 2008-08-08 21:56 Adel Gadllah
  2008-08-08 22:00 ` Adel Gadllah
  2008-08-09  3:39 ` Matthew Wilcox
  0 siblings, 2 replies; 8+ messages in thread
From: Adel Gadllah @ 2008-08-08 21:56 UTC (permalink / raw)
  To: linux-scsi
  Cc: FUJITA Tomonori, Jens Axboe, viro, Peter Jones, Matthew Wilcox,
	dougg, dan.j.williams, James.Bottomley

v4 remove linux/parser.h include

----------

This patch changes the interface of the cmd filter to use a +/- notation like:
echo -- +0x02 +0x03 -0x08
If neither + or - is given it defaults to + (allow command).

Note: The interface was added in 2.6.17-rc1 and is unused
and undocumented so far so it's safe to change it.

Cc: matthew@wil.cx
Cc: fujita.tomonori@lab.ntt.co.jp,
Cc: jens.axboe@oracle.com
Cc: James.Bottomley@hansenpartnership.com
Cc: dan.j.williams@intel.com
Cc: pjones@redhat.com
Cc: viro@zeniv.linux.org.uk
Cc: dougg@torque.net
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>

block/cmd-filter.c |   54 +++++++++++++++++++++++++++++----------------------
1 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/block/cmd-filter.c b/block/cmd-filter.c
index eec4404..70be62d 100644
--- a/block/cmd-filter.c
+++ b/block/cmd-filter.c
@@ -20,7 +20,6 @@
 #include <linux/list.h>
 #include <linux/genhd.h>
 #include <linux/spinlock.h>
-#include <linux/parser.h>
 #include <linux/capability.h>
 #include <linux/bitops.h>

@@ -84,8 +83,8 @@ static ssize_t rcf_cmds_show(struct
blk_scsi_cmd_filter *filter, char *page,

 	for (i = 0; i < BLK_SCSI_MAX_CMDS; i++) {
 		if (test_bit(i, okbits)) {
-			sprintf(npage, "%02x", i);
-			npage += 2;
+			sprintf(npage, "0x%02x", i);
+			npage += 4;
 			if (i < BLK_SCSI_MAX_CMDS - 1)
 				sprintf(npage++, " ");
 		}
@@ -111,32 +110,41 @@ static ssize_t rcf_writecmds_show(struct
blk_scsi_cmd_filter *filter,
 static ssize_t rcf_cmds_store(struct blk_scsi_cmd_filter *filter,
 			      const char *page, size_t count, int rw)
 {
-	ssize_t ret = 0;
 	unsigned long okbits[BLK_SCSI_CMD_PER_LONG], *target_okbits;
-	int cmd, status, len;
-	substring_t ss;
-
-	memset(&okbits, 0, sizeof(okbits));
-
-	for (len = strlen(page); len > 0; len -= 3) {
-		if (len < 2)
-			break;
-		ss.from = (char *) page + ret;
-		ss.to = (char *) page + ret + 2;
-		ret += 3;
-		status = match_hex(&ss, &cmd);
+	int cmd, set;
+	char *p, *status;
+
+	if (rw == READ) {
+		memcpy(&okbits, filter->read_ok, sizeof(okbits));
+		target_okbits = filter->read_ok;
+	} else {
+		memcpy(&okbits, filter->write_ok, sizeof(okbits));
+		target_okbits = filter->write_ok;
+	}
+
+	while ((p = strsep((char **)&page, " ")) != NULL) {
+		set = 1;
+
+		if (p[0] == '-') {
+			set = 0;
+			p++;
+		}
+
+		if (p[0] == '+')
+			p++;
+
+		cmd = simple_strtol(p, &status, 16);
+
 		/* either of these cases means invalid input, so do nothing. */
-		if (status || cmd >= BLK_SCSI_MAX_CMDS)
+		if ((status == p) || cmd >= BLK_SCSI_MAX_CMDS)
 			return -EINVAL;

-		__set_bit(cmd, okbits);
+		if (set)
+			__set_bit(cmd, okbits);
+		else
+			__clear_bit(cmd, okbits);
 	}

-	if (rw == READ)
-		target_okbits = filter->read_ok;
-	else
-		target_okbits = filter->write_ok;
-
 	memmove(target_okbits, okbits, sizeof(okbits));
 	return count;
 }

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

* Re: [PATCH v4] cmdfilter: clean up sysfs interface
  2008-08-08 21:56 [PATCH v4] cmdfilter: clean up sysfs interface Adel Gadllah
@ 2008-08-08 22:00 ` Adel Gadllah
  2008-08-09  3:39 ` Matthew Wilcox
  1 sibling, 0 replies; 8+ messages in thread
From: Adel Gadllah @ 2008-08-08 22:00 UTC (permalink / raw)
  To: linux-scsi
  Cc: FUJITA Tomonori, Jens Axboe, viro, Peter Jones, Matthew Wilcox,
	dougg, dan.j.williams, James.Bottomley

[-- Attachment #1: Type: text/plain, Size: 18 bytes --]

I hate gmail ....

[-- Attachment #2: cmd-filter-new-iface.patch --]
[-- Type: application/octet-stream, Size: 2815 bytes --]

This patch changes the interface of the cmd filter to use a +/- notation like:
echo -- +0x02 +0x03 -0x08
If neither + or - is given it defaults to + (allow command).

Note: The interface was added in 2.6.17-rc1 and is unused
and undocumented so far so it's safe to change it.

Cc: matthew@wil.cx
Cc: fujita.tomonori@lab.ntt.co.jp,
Cc: jens.axboe@oracle.com
Cc: James.Bottomley@hansenpartnership.com
Cc: dan.j.williams@intel.com
Cc: pjones@redhat.com
Cc: viro@zeniv.linux.org.uk
Cc: dougg@torque.net
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>

block/cmd-filter.c |   54 +++++++++++++++++++++++++++++----------------------
1 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/block/cmd-filter.c b/block/cmd-filter.c
index eec4404..70be62d 100644
--- a/block/cmd-filter.c
+++ b/block/cmd-filter.c
@@ -20,7 +20,6 @@
 #include <linux/list.h>
 #include <linux/genhd.h>
 #include <linux/spinlock.h>
-#include <linux/parser.h>
 #include <linux/capability.h>
 #include <linux/bitops.h>
 
@@ -84,8 +83,8 @@ static ssize_t rcf_cmds_show(struct blk_scsi_cmd_filter *filter, char *page,
 
 	for (i = 0; i < BLK_SCSI_MAX_CMDS; i++) {
 		if (test_bit(i, okbits)) {
-			sprintf(npage, "%02x", i);
-			npage += 2;
+			sprintf(npage, "0x%02x", i);
+			npage += 4;
 			if (i < BLK_SCSI_MAX_CMDS - 1)
 				sprintf(npage++, " ");
 		}
@@ -111,32 +110,41 @@ static ssize_t rcf_writecmds_show(struct blk_scsi_cmd_filter *filter,
 static ssize_t rcf_cmds_store(struct blk_scsi_cmd_filter *filter,
 			      const char *page, size_t count, int rw)
 {
-	ssize_t ret = 0;
 	unsigned long okbits[BLK_SCSI_CMD_PER_LONG], *target_okbits;
-	int cmd, status, len;
-	substring_t ss;
-
-	memset(&okbits, 0, sizeof(okbits));
-
-	for (len = strlen(page); len > 0; len -= 3) {
-		if (len < 2)
-			break;
-		ss.from = (char *) page + ret;
-		ss.to = (char *) page + ret + 2;
-		ret += 3;
-		status = match_hex(&ss, &cmd);
+	int cmd, set;
+	char *p, *status;
+
+	if (rw == READ) {
+		memcpy(&okbits, filter->read_ok, sizeof(okbits));
+		target_okbits = filter->read_ok;
+	} else {
+		memcpy(&okbits, filter->write_ok, sizeof(okbits));
+		target_okbits = filter->write_ok;
+	}
+
+	while ((p = strsep((char **)&page, " ")) != NULL) {
+		set = 1;
+
+		if (p[0] == '-') {
+			set = 0;
+			p++;
+		}
+
+		if (p[0] == '+')
+			p++;
+
+		cmd = simple_strtol(p, &status, 16);
+
 		/* either of these cases means invalid input, so do nothing. */
-		if (status || cmd >= BLK_SCSI_MAX_CMDS)
+		if ((status == p) || cmd >= BLK_SCSI_MAX_CMDS)
 			return -EINVAL;
 
-		__set_bit(cmd, okbits);
+		if (set)
+			__set_bit(cmd, okbits);
+		else
+			__clear_bit(cmd, okbits);
 	}
 
-	if (rw == READ)
-		target_okbits = filter->read_ok;
-	else
-		target_okbits = filter->write_ok;
-
 	memmove(target_okbits, okbits, sizeof(okbits));
 	return count;
 }

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

* Re: [PATCH v4] cmdfilter: clean up sysfs interface
  2008-08-08 21:56 [PATCH v4] cmdfilter: clean up sysfs interface Adel Gadllah
  2008-08-08 22:00 ` Adel Gadllah
@ 2008-08-09  3:39 ` Matthew Wilcox
  2008-08-09 10:09   ` [PATCH v5] " Adel Gadllah
  1 sibling, 1 reply; 8+ messages in thread
From: Matthew Wilcox @ 2008-08-09  3:39 UTC (permalink / raw)
  To: Adel Gadllah
  Cc: linux-scsi, FUJITA Tomonori, Jens Axboe, viro, Peter Jones, dougg,
	dan.j.williams, James.Bottomley

On Fri, Aug 08, 2008 at 11:56:35PM +0200, Adel Gadllah wrote:
> @@ -84,8 +83,8 @@ static ssize_t rcf_cmds_show(struct
> blk_scsi_cmd_filter *filter, char *page,
> 
>  	for (i = 0; i < BLK_SCSI_MAX_CMDS; i++) {
>  		if (test_bit(i, okbits)) {
> -			sprintf(npage, "%02x", i);
> -			npage += 2;
> +			sprintf(npage, "0x%02x", i);
> +			npage += 4;
>  			if (i < BLK_SCSI_MAX_CMDS - 1)
>  				sprintf(npage++, " ");
>  		}

Why not:

			npage += sprintf(npage, "0x%02x", i);
?  (and before anyone suggests snprintf, we can at most have 256
entries, each consuming 5 bytes.  5 * 256 <3k and no arch has less than
a 4k page size.  so we can't overflow the buffer.)

> @@ -111,32 +110,41 @@ static ssize_t rcf_writecmds_show(struct
> blk_scsi_cmd_filter *filter,
>  static ssize_t rcf_cmds_store(struct blk_scsi_cmd_filter *filter,
>  			      const char *page, size_t count, int rw)
>  {
> -	ssize_t ret = 0;
>  	unsigned long okbits[BLK_SCSI_CMD_PER_LONG], *target_okbits;
> -	int cmd, status, len;
> -	substring_t ss;
> -
> -	memset(&okbits, 0, sizeof(okbits));
> -
> -	for (len = strlen(page); len > 0; len -= 3) {
> -		if (len < 2)
> -			break;
> -		ss.from = (char *) page + ret;
> -		ss.to = (char *) page + ret + 2;
> -		ret += 3;
> -		status = match_hex(&ss, &cmd);
> +	int cmd, set;
> +	char *p, *status;
> +
> +	if (rw == READ) {
> +		memcpy(&okbits, filter->read_ok, sizeof(okbits));
> +		target_okbits = filter->read_ok;
> +	} else {
> +		memcpy(&okbits, filter->write_ok, sizeof(okbits));
> +		target_okbits = filter->write_ok;
> +	}
> +
> +	while ((p = strsep((char **)&page, " ")) != NULL) {
> +		set = 1;
> +
> +		if (p[0] == '-') {
> +			set = 0;
> +			p++;
> +		}
> +
> +		if (p[0] == '+')
> +			p++;
> +
> +		cmd = simple_strtol(p, &status, 16);
> +
>  		/* either of these cases means invalid input, so do nothing. */
> -		if (status || cmd >= BLK_SCSI_MAX_CMDS)
> +		if ((status == p) || cmd >= BLK_SCSI_MAX_CMDS)
>  			return -EINVAL;

Doesn't this accept -+0x20 for example?  Why not:

		set = 1;
		if (p[0] == '+') {
			p++;
		} else if (p[0] == '-') {
			set = 0;
			p++;
		}
		cmd = simple_strtol(p, &status, 16);

> -		__set_bit(cmd, okbits);
> +		if (set)
> +			__set_bit(cmd, okbits);
> +		else
> +			__clear_bit(cmd, okbits);
>  	}
> 
> -	if (rw == READ)
> -		target_okbits = filter->read_ok;
> -	else
> -		target_okbits = filter->write_ok;
> -
>  	memmove(target_okbits, okbits, sizeof(okbits));

target_okbits can't overlap with okbits, so you can use memcpy instead
of memmove here.

>  	return count;
>  }

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

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

* [PATCH v5] cmdfilter: clean up sysfs interface
  2008-08-09  3:39 ` Matthew Wilcox
@ 2008-08-09 10:09   ` Adel Gadllah
  2008-08-09 13:55     ` Matthew Wilcox
  0 siblings, 1 reply; 8+ messages in thread
From: Adel Gadllah @ 2008-08-09 10:09 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: linux-scsi, FUJITA Tomonori, Jens Axboe, viro, Peter Jones, dougg,
	dan.j.williams, James.Bottomley

[-- Attachment #1: Type: text/plain, Size: 5227 bytes --]

2008/8/9 Matthew Wilcox <matthew@wil.cx>:
> On Fri, Aug 08, 2008 at 11:56:35PM +0200, Adel Gadllah wrote:
>> @@ -84,8 +83,8 @@ static ssize_t rcf_cmds_show(struct
>> blk_scsi_cmd_filter *filter, char *page,
>>
>>       for (i = 0; i < BLK_SCSI_MAX_CMDS; i++) {
>>               if (test_bit(i, okbits)) {
>> -                     sprintf(npage, "%02x", i);
>> -                     npage += 2;
>> +                     sprintf(npage, "0x%02x", i);
>> +                     npage += 4;
>>                       if (i < BLK_SCSI_MAX_CMDS - 1)
>>                               sprintf(npage++, " ");
>>               }
>
> Why not:
>
>                        npage += sprintf(npage, "0x%02x", i);
> ?

no reason .. that how the original patch was... changed it.


>> +     while ((p = strsep((char **)&page, " ")) != NULL) {
>> +             set = 1;
>> +
>> +             if (p[0] == '-') {
>> +                     set = 0;
>> +                     p++;
>> +             }
>> +
>> +             if (p[0] == '+')
>> +                     p++;
>> +
>> +             cmd = simple_strtol(p, &status, 16);
>> +
>>               /* either of these cases means invalid input, so do nothing. */
>> -             if (status || cmd >= BLK_SCSI_MAX_CMDS)
>> +             if ((status == p) || cmd >= BLK_SCSI_MAX_CMDS)
>>                       return -EINVAL;
>
> Doesn't this accept -+0x20 for example?  Why not:

-+ seems abit odd....

>                set = 1;
>                if (p[0] == '+') {
>                        p++;
>                } else if (p[0] == '-') {
>                        set = 0;
>                        p++;
>                }
>                cmd = simple_strtol(p, &status, 16);

done

>> -             __set_bit(cmd, okbits);
>> +             if (set)
>> +                     __set_bit(cmd, okbits);
>> +             else
>> +                     __clear_bit(cmd, okbits);
>>       }
>>
>> -     if (rw == READ)
>> -             target_okbits = filter->read_ok;
>> -     else
>> -             target_okbits = filter->write_ok;
>> -
>>       memmove(target_okbits, okbits, sizeof(okbits));
>
> target_okbits can't overlap with okbits, so you can use memcpy instead
> of memmove here.

left over from the old patch, changed.

v5 attached with this changed (build tested only)

------------------------
This patch changes the interface of the cmd filter to use a +/- notation like:
echo -- +0x02 +0x03 -0x08
If neither + or - is given it defaults to + (allow command).

Note: The interface was added in 2.6.17-rc1 and is unused
and undocumented so far so it's safe to change it.

Cc: matthew@wil.cx
Cc: fujita.tomonori@lab.ntt.co.jp
Cc: jens.axboe@oracle.com
Cc: James.Bottomley@hansenpartnership.com
Cc: dan.j.williams@intel.com
Cc: pjones@redhat.com
Cc: viro@zeniv.linux.org.uk
Cc: dougg@torque.net
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>

 block/cmd-filter.c |   54 ++++++++++++++++++++++++++++-----------------------
 1 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/block/cmd-filter.c b/block/cmd-filter.c
index eec4404..e51648c 100644
--- a/block/cmd-filter.c
+++ b/block/cmd-filter.c
@@ -20,7 +20,6 @@
 #include <linux/list.h>
 #include <linux/genhd.h>
 #include <linux/spinlock.h>
-#include <linux/parser.h>
 #include <linux/capability.h>
 #include <linux/bitops.h>

@@ -84,8 +83,7 @@ static ssize_t rcf_cmds_show(struct
blk_scsi_cmd_filter *filter, char *page,

 	for (i = 0; i < BLK_SCSI_MAX_CMDS; i++) {
 		if (test_bit(i, okbits)) {
-			sprintf(npage, "%02x", i);
-			npage += 2;
+			npage += sprintf(npage, "0x%02x", i);
 			if (i < BLK_SCSI_MAX_CMDS - 1)
 				sprintf(npage++, " ");
 		}
@@ -111,33 +109,41 @@ static ssize_t rcf_writecmds_show(struct
blk_scsi_cmd_filter *filter,
 static ssize_t rcf_cmds_store(struct blk_scsi_cmd_filter *filter,
 			      const char *page, size_t count, int rw)
 {
-	ssize_t ret = 0;
 	unsigned long okbits[BLK_SCSI_CMD_PER_LONG], *target_okbits;
-	int cmd, status, len;
-	substring_t ss;
-
-	memset(&okbits, 0, sizeof(okbits));
-
-	for (len = strlen(page); len > 0; len -= 3) {
-		if (len < 2)
-			break;
-		ss.from = (char *) page + ret;
-		ss.to = (char *) page + ret + 2;
-		ret += 3;
-		status = match_hex(&ss, &cmd);
+	int cmd, set;
+	char *p, *status;
+
+	if (rw == READ) {
+		memcpy(&okbits, filter->read_ok, sizeof(okbits));
+		target_okbits = filter->read_ok;
+	} else {
+		memcpy(&okbits, filter->write_ok, sizeof(okbits));
+		target_okbits = filter->write_ok;
+	}
+
+	while ((p = strsep((char **)&page, " ")) != NULL) {
+		set = 1;
+
+		if (p[0] == '+') {
+			p++;
+		} else if (p[0] == '-') {
+			set = 0;
+			p++;
+		}
+
+		cmd = simple_strtol(p, &status, 16);
+
 		/* either of these cases means invalid input, so do nothing. */
-		if (status || cmd >= BLK_SCSI_MAX_CMDS)
+		if ((status == p) || cmd >= BLK_SCSI_MAX_CMDS)
 			return -EINVAL;

-		__set_bit(cmd, okbits);
+		if (set)
+			__set_bit(cmd, okbits);
+		else
+			__clear_bit(cmd, okbits);
 	}

-	if (rw == READ)
-		target_okbits = filter->read_ok;
-	else
-		target_okbits = filter->write_ok;
-
-	memmove(target_okbits, okbits, sizeof(okbits));
+	memcpy(target_okbits, okbits, sizeof(okbits));
 	return count;
 }

----
attached in case gmail breaks it again

[-- Attachment #2: cmd-filter-new-iface.patch --]
[-- Type: application/octet-stream, Size: 2867 bytes --]

This patch changes the interface of the cmd filter to use a +/- notation like:
echo -- +0x02 +0x03 -0x08
If neither + or - is given it defaults to + (allow command).

Note: The interface was added in 2.6.17-rc1 and is unused
and undocumented so far so it's safe to change it.

Cc: matthew@wil.cx
Cc: fujita.tomonori@lab.ntt.co.jp
Cc: jens.axboe@oracle.com
Cc: James.Bottomley@hansenpartnership.com
Cc: dan.j.williams@intel.com
Cc: pjones@redhat.com
Cc: viro@zeniv.linux.org.uk
Cc: dougg@torque.net
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>

 block/cmd-filter.c |   54 ++++++++++++++++++++++++++++-----------------------
 1 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/block/cmd-filter.c b/block/cmd-filter.c
index eec4404..e51648c 100644
--- a/block/cmd-filter.c
+++ b/block/cmd-filter.c
@@ -20,7 +20,6 @@
 #include <linux/list.h>
 #include <linux/genhd.h>
 #include <linux/spinlock.h>
-#include <linux/parser.h>
 #include <linux/capability.h>
 #include <linux/bitops.h>
 
@@ -84,8 +83,7 @@ static ssize_t rcf_cmds_show(struct blk_scsi_cmd_filter *filter, char *page,
 
 	for (i = 0; i < BLK_SCSI_MAX_CMDS; i++) {
 		if (test_bit(i, okbits)) {
-			sprintf(npage, "%02x", i);
-			npage += 2;
+			npage += sprintf(npage, "0x%02x", i);
 			if (i < BLK_SCSI_MAX_CMDS - 1)
 				sprintf(npage++, " ");
 		}
@@ -111,33 +109,41 @@ static ssize_t rcf_writecmds_show(struct blk_scsi_cmd_filter *filter,
 static ssize_t rcf_cmds_store(struct blk_scsi_cmd_filter *filter,
 			      const char *page, size_t count, int rw)
 {
-	ssize_t ret = 0;
 	unsigned long okbits[BLK_SCSI_CMD_PER_LONG], *target_okbits;
-	int cmd, status, len;
-	substring_t ss;
-
-	memset(&okbits, 0, sizeof(okbits));
-
-	for (len = strlen(page); len > 0; len -= 3) {
-		if (len < 2)
-			break;
-		ss.from = (char *) page + ret;
-		ss.to = (char *) page + ret + 2;
-		ret += 3;
-		status = match_hex(&ss, &cmd);
+	int cmd, set;
+	char *p, *status;
+
+	if (rw == READ) {
+		memcpy(&okbits, filter->read_ok, sizeof(okbits));
+		target_okbits = filter->read_ok;
+	} else {
+		memcpy(&okbits, filter->write_ok, sizeof(okbits));
+		target_okbits = filter->write_ok;
+	}
+
+	while ((p = strsep((char **)&page, " ")) != NULL) {
+		set = 1;
+
+		if (p[0] == '+') {
+			p++;
+		} else if (p[0] == '-') {
+			set = 0;
+			p++;
+		}
+
+		cmd = simple_strtol(p, &status, 16);
+
 		/* either of these cases means invalid input, so do nothing. */
-		if (status || cmd >= BLK_SCSI_MAX_CMDS)
+		if ((status == p) || cmd >= BLK_SCSI_MAX_CMDS)
 			return -EINVAL;
 
-		__set_bit(cmd, okbits);
+		if (set)
+			__set_bit(cmd, okbits);
+		else
+			__clear_bit(cmd, okbits);
 	}
 
-	if (rw == READ)
-		target_okbits = filter->read_ok;
-	else
-		target_okbits = filter->write_ok;
-
-	memmove(target_okbits, okbits, sizeof(okbits));
+	memcpy(target_okbits, okbits, sizeof(okbits));
 	return count;
 }
 

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

* Re: [PATCH v5] cmdfilter: clean up sysfs interface
  2008-08-09 10:09   ` [PATCH v5] " Adel Gadllah
@ 2008-08-09 13:55     ` Matthew Wilcox
  2008-08-10  7:31       ` FUJITA Tomonori
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Wilcox @ 2008-08-09 13:55 UTC (permalink / raw)
  To: Adel Gadllah
  Cc: linux-scsi, FUJITA Tomonori, Jens Axboe, viro, Peter Jones, dougg,
	dan.j.williams, James.Bottomley

On Sat, Aug 09, 2008 at 12:09:38PM +0200, Adel Gadllah wrote:
> ------------------------
> This patch changes the interface of the cmd filter to use a +/- notation like:
> echo -- +0x02 +0x03 -0x08
> If neither + or - is given it defaults to + (allow command).
> 
> Note: The interface was added in 2.6.17-rc1 and is unused
> and undocumented so far so it's safe to change it.
> 
> Cc: matthew@wil.cx
> Cc: fujita.tomonori@lab.ntt.co.jp
> Cc: jens.axboe@oracle.com
> Cc: James.Bottomley@hansenpartnership.com
> Cc: dan.j.williams@intel.com
> Cc: pjones@redhat.com
> Cc: viro@zeniv.linux.org.uk
> Cc: dougg@torque.net
> Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>

Reviewed-by: Matthew Wilcox <willy@linux.intel.com>



-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

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

* Re: [PATCH v5] cmdfilter: clean up sysfs interface
  2008-08-09 13:55     ` Matthew Wilcox
@ 2008-08-10  7:31       ` FUJITA Tomonori
  2008-11-01 17:56         ` Adel Gadllah
  0 siblings, 1 reply; 8+ messages in thread
From: FUJITA Tomonori @ 2008-08-10  7:31 UTC (permalink / raw)
  To: matthew
  Cc: adel.gadllah, linux-scsi, fujita.tomonori, jens.axboe, viro,
	pjones, dougg, dan.j.williams, James.Bottomley

On Sat, 9 Aug 2008 07:55:21 -0600
Matthew Wilcox <matthew@wil.cx> wrote:

> On Sat, Aug 09, 2008 at 12:09:38PM +0200, Adel Gadllah wrote:
> > ------------------------
> > This patch changes the interface of the cmd filter to use a +/- notation like:
> > echo -- +0x02 +0x03 -0x08
> > If neither + or - is given it defaults to + (allow command).
> > 
> > Note: The interface was added in 2.6.17-rc1 and is unused
> > and undocumented so far so it's safe to change it.
> > 
> > Cc: matthew@wil.cx
> > Cc: fujita.tomonori@lab.ntt.co.jp
> > Cc: jens.axboe@oracle.com
> > Cc: James.Bottomley@hansenpartnership.com
> > Cc: dan.j.williams@intel.com
> > Cc: pjones@redhat.com
> > Cc: viro@zeniv.linux.org.uk
> > Cc: dougg@torque.net
> > Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
> 
> Reviewed-by: Matthew Wilcox <willy@linux.intel.com>

I am also fine with this version.

After using this API a bit, I thought that this interface is a bit
unhandy when I just want to set up new access permissions from the
scratch though the new interface is handy when I want to modify the
current permissions.

I guess that in some cases (such as on bootup), we don't care about
the current permissions, just want to set up our permissions. It would
be nice if we can drop the current permissions (all the commands are
prohibited), something like "echo -- > read_table"

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

* Re: [PATCH v5] cmdfilter: clean up sysfs interface
  2008-08-10  7:31       ` FUJITA Tomonori
@ 2008-11-01 17:56         ` Adel Gadllah
  2008-11-03  4:01           ` FUJITA Tomonori
  0 siblings, 1 reply; 8+ messages in thread
From: Adel Gadllah @ 2008-11-01 17:56 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: matthew, linux-scsi, jens.axboe, viro, pjones, dougg,
	dan.j.williams, James.Bottomley

The sysfs bits got disabled in 2.6.27 in commit
2dc75d3c3b49c64fd26b4832a7efb75546cb3fc5 .
What are the remaining bugs that needs to get fixed to reenable it for
2.6.28 (or if its too late .29) ?

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

* Re: [PATCH v5] cmdfilter: clean up sysfs interface
  2008-11-01 17:56         ` Adel Gadllah
@ 2008-11-03  4:01           ` FUJITA Tomonori
  0 siblings, 0 replies; 8+ messages in thread
From: FUJITA Tomonori @ 2008-11-03  4:01 UTC (permalink / raw)
  To: adel.gadllah
  Cc: fujita.tomonori, matthew, linux-scsi, jens.axboe, viro, pjones,
	dougg, dan.j.williams, James.Bottomley

On Sat, 1 Nov 2008 18:56:20 +0100
"Adel Gadllah" <adel.gadllah@gmail.com> wrote:

> The sysfs bits got disabled in 2.6.27 in commit
> 2dc75d3c3b49c64fd26b4832a7efb75546cb3fc5 .
> What are the remaining bugs that needs to get fixed to reenable it for
> 2.6.28 (or if its too late .29) ?

cmdfilter has some design problems related with the way to use kobject
(discussed several times on lkml during 2.6.27-rcX cycles). As far as
I know, nobody tries to fix them.

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

end of thread, other threads:[~2008-11-03  4:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-08 21:56 [PATCH v4] cmdfilter: clean up sysfs interface Adel Gadllah
2008-08-08 22:00 ` Adel Gadllah
2008-08-09  3:39 ` Matthew Wilcox
2008-08-09 10:09   ` [PATCH v5] " Adel Gadllah
2008-08-09 13:55     ` Matthew Wilcox
2008-08-10  7:31       ` FUJITA Tomonori
2008-11-01 17:56         ` Adel Gadllah
2008-11-03  4:01           ` FUJITA Tomonori

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).