mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Octavian Purdila <opurdila@ixiacom.com>
To: Cong Wang <amwang@redhat.com>
Cc: David Miller <davem@davemloft.net>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Linux Kernel Developers <linux-kernel@vger.kernel.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [net-next PATCH v5 2/3] sysctl: add proc_do_large_bitmap
Date: Wed, 24 Feb 2010 14:02:54 +0200	[thread overview]
Message-ID: <201002241402.54122.opurdila@ixiacom.com> (raw)
In-Reply-To: <4B84B7F0.7090709@redhat.com>

[-- Attachment #1: Type: Text/Plain, Size: 1742 bytes --]


On Wednesday 24 February 2010 07:24:00 you wrote:
> Octavian Purdila wrote:
> > Here is a new version of this patch which fixes both the comma and
> > invalid value issues, please give it a try.
> 
> Sorry, it is even worse. :(
> 
> > [net-next PATCH v5 2/3] sysctl: add proc_do_large_bitmap
> >
> > The new function can be used to read/write large bitmaps via /proc. A
> > comma separated range format is used for compact output and input
> > (e.g. 1,3-4,10-10).
> 
> Writing "50000-50100" gets EINVAL, it should be success.
> Writing "50000,50100" fails too.
> 

Hmm, they don't fail for me :-/

> Please, at least, do some basic testing.
> 

I do test them, I've attached the current test batch I was using.

Anyways, today I've noticed that "1,2 3" does not fail and even more 
importantly the final value is "3". 

Being that I don't see a way of fixing this without not acknowledging 1,2 even 
though we will do set these values, I revisited the "1 2 3" issue. And I don't 
understand why this is actually an issue, we are just being more permissive 
(i.e. we are allowing as separators both whitespaces and ,).


> Also some comments below.
> 
> > diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> > index 5259727..d8ea839 100644
> > --- a/kernel/sysctl.c
> > +++ b/kernel/sysctl.c
> > @@ -2635,6 +2635,140 @@ static int proc_do_cad_pid(struct ctl_table
> > *table, int write,
> 
> The above line is wrong, it should be a part of previous line.
> 

Probably my email client corrupted the patch, sorry about that, I will be more 
careful next time.

> > +	int left = *lenp, err = 0;
> 
> 'left' should be size_t.
> 

Will fix, thanks for catching this.

I will resend the whole patch series once we get this formatting issue 
resolved.

[-- Attachment #2: rp_test.log --]
[-- Type: text/x-log, Size: 1341 bytes --]

+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
40002
+ echo 50000
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
50000
+ echo 50000-50100
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
50000-50100
+ echo
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports

+ echo 40000-50000,50000-50100,50101-50101
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
40000-50101
+ set +e
+ echo 40000a
rp_test.sh: line 12: echo: write error: Invalid argument
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
40000-50101
+ echo 40000-
rp_test.sh: line 14: echo: write error: Invalid argument
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
40000-50101
+ echo 70000
rp_test.sh: line 16: echo: write error: Invalid argument
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
40000-50101
+ echo 40000-30000
rp_test.sh: line 18: echo: write error: Invalid argument
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
40000-50101
+ echo 40000,
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
40000
+ echo 40000,40001,40000b
rp_test.sh: line 22: echo: write error: Invalid argument
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
40000-40001
+ echo 40000 40001 40002
rp_test.sh: line 24: echo: write error: Invalid argument
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
40000-40001
+ echo 40000,40001 40002
+ cat /proc/sys/net/ipv4/ip_local_reserved_ports
40002

[-- Attachment #3: rp_test.sh --]
[-- Type: application/x-shellscript, Size: 1373 bytes --]

  parent reply	other threads:[~2010-02-24 12:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-21 11:42 Octavian Purdila
2010-02-22  2:45 ` Cong Wang
2010-02-22 16:29   ` Octavian Purdila
2010-02-24  5:24     ` Cong Wang
2010-02-24  5:34       ` Cong Wang
2010-02-24 12:02       ` Octavian Purdila [this message]
2010-02-25  1:17         ` Cong Wang
2010-02-25  3:18           ` Cong Wang
  -- strict thread matches above, loose matches on Subject: below --
2010-02-25 11:02 Octavian Purdila
2010-02-26  2:26 ` Cong Wang
2010-02-25  9:46 Octavian Purdila
2010-02-25  9:54 ` Cong Wang
2010-02-18 22:32 Octavian Purdila
2010-02-21  6:35 ` Cong Wang

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=201002241402.54122.opurdila@ixiacom.com \
    --to=opurdila@ixiacom.com \
    --cc=amwang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®