From: David Howells <dhowells@redhat.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] PROC: Make proc_dir_entry::name a terminal array rather than a pointer
Date: Tue, 07 Jun 2011 10:03:49 +0100 [thread overview]
Message-ID: <9444.1307437429@redhat.com> (raw)
In-Reply-To: <20110607055025.GA14145@p183.telecom.by>
Alexey Dobriyan <adobriyan@gmail.com> wrote:
> Might as well move "namelen" next to the end.
Good point. Before:
(gdb) p &(((struct proc_dir_entry*)0)->name)
$1 = (char (*)[]) 0xc0
After:
(gdb) p &(((struct proc_dir_entry*)0)->name)
$2 = (char (*)[]) 0xbc
The size is 192 in either case; the name just overlaps the hole at the end of
the structure.
Also, whilst I'm at it:
(1) pde_unload_lock can be put two places later, so that if it's just a
32-bit word, there won't be a hole left in the struct on a 64-bit
machine.
(2) namelen doesn't need to be a 32-bit word, but can be an 8-bit value as it
doesn't have to exceed NAME_MAX.
David
next prev parent reply other threads:[~2011-06-07 9:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-06 15:41 [PATCH] PROC: Make proc_dir_entry::name a terminal array rather than a pointer David Howells
2011-06-07 5:50 ` Alexey Dobriyan
2011-06-07 9:03 ` David Howells [this message]
2011-06-07 9:18 ` Alexey Dobriyan
2011-06-07 9:58 ` David Howells
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=9444.1307437429@redhat.com \
--to=dhowells@redhat.com \
--cc=adobriyan@gmail.com \
--cc=linux-fsdevel@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).