From: Wagner Ferenc <wferi@niif.hu>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: bonding sysfs output
Date: Mon, 26 Nov 2007 09:29:40 +0100 [thread overview]
Message-ID: <87lk8lflzf.fsf@szonett.ki.iif.hu> (raw)
In-Reply-To: <20071125205150.4e49915f.akpm@linux-foundation.org> (Andrew Morton's message of "Sun, 25 Nov 2007 20:51:50 -0800")
Andrew Morton <akpm@linux-foundation.org> writes:
> On Sun, 25 Nov 2007 16:12:57 +0100 Wagner Ferenc <wferi@niif.hu> wrote:
>
>> I propose it as a fix for trailing NULs and spaces like eg.
>>
>> $ od -c /sys/class/net/bond0/bonding/slaves
>> 0000000 e t h - l e f t e t h - r i g
>> 0000020 h t \n \0
>> 0000025
>>
>> I'm afraid there're other problems with "++more++" handling, but let's
>> not consider those just yet. Find the patch attached. The first
>> hunks also renames buffer to buf, for consistency's shake.
>>
>> The original version had varying behaviour for Not Applicable cases.
>> This patch also settles for empty files (not even a line feed) in
>> those cases, but I'm not sure about the general policy on this matter.
>
> hm, there are a lot of changes there. Were they all actually needed to fix
> the one bug which you have described?
Trailing NULs are present in each file under /sys/class/net/*/bonding
and also in /sys/class/net/bonding_masters. That is, in every file
provided by drivers/net/bonding/bond_sysfs.c. Most of the patch is
concerned with this.
Closely related is the presence of trailing spaces in multivalue
files. There are three such files, one of them has the trailing space
removed. This patch removes it from the other two. During this it
also renames one function argument 'buffer' to 'buf', for consistency.
On the policy side: some files are not applicable to some types of
bonds, and return a single linefeed in that case. Except for one
single case, which returns 'NA\n'. The patch changes these cases into
emtpy files.
If these are worthy changes, I'm absolutely willing to split up the
patch into three parts as the above.
--
Thanks,
Feri.
next prev parent reply other threads:[~2007-11-26 8:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87tznafjeu.fsf@szonett.ki.iif.hu>
2007-11-26 4:51 ` bonding sysfs output Andrew Morton
2007-11-26 8:29 ` Wagner Ferenc [this message]
2007-11-27 8:44 ` Andrew Morton
2007-11-27 9:56 ` Ferenc Wagner
2007-11-27 10:14 ` Andrew Morton
2007-11-28 1:03 ` Wagner Ferenc
2007-12-05 22:59 ` Jean Delvare
2007-12-06 10:13 ` Ferenc Wagner
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=87lk8lflzf.fsf@szonett.ki.iif.hu \
--to=wferi@niif.hu \
--cc=akpm@linux-foundation.org \
--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;
as well as URLs for NNTP newsgroup(s).