From: Andrew <cmkrnl@speakeasy.net>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Patch] 2.6.10.rc1.bk6 /lib/kobject_uevent.c buffer issues
Date: Wed, 27 Oct 2004 12:31:52 -0400 [thread overview]
Message-ID: <417FCD78.6020807@speakeasy.net> (raw)
In-Reply-To: <20041027152134.GA13991@kroah.com>
Greg KH wrote:
>
>
> Why not just use the same buffer? We should be able to do that.
>
>
> I'd prefer we use the same buffer. Care to respin your patch?
>
Sure, I can only see two ways of achieving that however.
1) Change the API of kset_hotplug_ops.hotplug() to return the amount
of consumed buffer (and possibly an updated value for i (num_envp)
and then changing every real function that implements that interface
or
2) Spin through the envp[] starting at i to NUM_ENVP looking for a NULL
pointer dropping back 1 (last_used) then do a
scratch += strlen(envp[last_used]) + 1
I don't know if you would rather keep the kset_hotplug_ops.hotplug() API
unchanged and have a "find the NULL" or vice-versa? -- or are both
too ugly? Ultimately the first option would generate the "cleanest"
solution, but I would be wary to change an API (especially one I didn't
create myself)
I can also see variation of 2), where buffer is prefilled with something
like '0xff' then the find the null would run in reverse from
buffer+BUFFER_SIZE-1. Either way with 2), the reservation in envp[] for
the seq_num would have to stay, but its locaton in buffer would be at the
end. As a bonus of course then the call to send_uevent could see the
entire buffer.
I'm looking now for how many changes would be required to do option 1.
Andrew
> thanks,
>
> greg k-h
>
>
next prev parent reply other threads:[~2004-10-27 16:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20041027142925.GA17484@imladris.arnor.me>
2004-10-27 15:21 ` [Patch] 2.6.10.rc1.bk6 /lib/kobject_uevent.c buffer issues Greg KH
2004-10-27 16:31 ` Andrew [this message]
2004-10-29 20:13 ` Greg KH
2004-10-29 21:28 ` Kay Sievers
2004-10-29 23:13 ` Greg KH
2004-10-30 0:00 ` Kay Sievers
2004-10-30 0:25 ` Kay Sievers
2004-10-30 2:54 ` Kay Sievers
2004-10-30 3:23 ` Andrew
2004-10-31 4:11 ` Kay Sievers
2004-11-01 19:46 ` Greg KH
2004-10-27 17:17 Klaus Dittrich
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=417FCD78.6020807@speakeasy.net \
--to=cmkrnl@speakeasy.net \
--cc=greg@kroah.com \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.