From: Jeff Liu <jeff.liu@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] Use bigger nodestr to accomodate 32-bit node numbers
Date: Thu, 29 Aug 2013 17:52:33 +0800 [thread overview]
Message-ID: <521F19E1.8010600@oracle.com> (raw)
In-Reply-To: <20130828041547.GA4404@shrek.cartoons>
Hi Goldwyn,
On 08/28/2013 12:15 PM, Goldwyn Rodrigues wrote:
> While using pacemaker/corosync, the node numbers are generated using
> IP address as opposed to serial node number generation. This may
> not fit in a 8-byte string. Use a bigger string to print the
> complete node number.
I have no experience of pacemaker/corosync, so here is my comments
pointing against this change only if we would expand the nodestr. :)
>
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
> ---
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index 854d809..bc947e0 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -1022,7 +1022,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
> struct inode *inode = NULL;
> struct ocfs2_super *osb = NULL;
> struct buffer_head *bh = NULL;
> - char nodestr[8];
> + char nodestr[12];
We have the corresponding debugging logic at ocfs2_dismount_volume(), which
defines the nodestr with the old size, it seems that this change would cause
potential buffer overflow while restore a bigger nodestr at it.
Also, there might has another relationship to ocfs2_control_message_setn/down
at stack_user.c because we limit the length of nodenum with a marco:
#define OCFS2_CONTROL_MESSAGE_NODENUM_LEN 8
Maybe we should unify them?
Thanks,
-Jeff
next prev parent reply other threads:[~2013-08-29 9:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 4:15 [Ocfs2-devel] [PATCH] Use bigger nodestr to accomodate 32-bit node numbers Goldwyn Rodrigues
2013-08-29 9:52 ` Jeff Liu [this message]
2013-08-29 12:15 ` Goldwyn Rodrigues
2013-08-29 19:26 ` Andrew Morton
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=521F19E1.8010600@oracle.com \
--to=jeff.liu@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/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).