public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Hamish Moffatt <hamish@cloud.net.au>
To: linux-mtd@lists.infradead.org
Subject: [RFC][PATCH] making ubifs compile with gcc-3.4
Date: Fri, 2 May 2008 15:22:11 +1000	[thread overview]
Message-ID: <20080502052211.GB6654@cloud.net.au> (raw)

ubifs fails to compile with my gcc 3.4.4 (for arm), bombing with:

fs/built-in.o: In function `ubifs_create_dflt_lpt':
lpt_commit.c:(.text+0x88690): undefined reference to `__you_cannot_kmalloc_that_much'
make[1]: *** [.tmp_vmlinux1] Error 1

It compiles with 4.1.2 ok though. Some web searches suggest that this is
due to a compiler bug. Patches have been applied in other parts of the 
tree to work around this so perhaps you'll consider this patch for ubifs 
also.

I found that rearranging the kmalloc order makes it compile. I don't
believe there is any effect on the behaviour.

Signed-off-by: Hamish Moffatt <hamish@cloud.net.au>

--

--- a/fs/ubifs/lpt.c	(revision 4400)
+++ b/fs/ubifs/lpt.c	(working copy)
@@ -597,11 +597,11 @@
 	/* Needed by 'ubifs_pack_lsave()' */
 	c->main_first = c->leb_cnt - *main_lebs;
 
+	lsave = kmalloc(sizeof(int) * c->lsave_cnt, GFP_KERNEL);
 	pnode = kzalloc(sizeof(struct ubifs_pnode), GFP_KERNEL);
 	nnode = kzalloc(sizeof(struct ubifs_nnode), GFP_KERNEL);
 	buf = vmalloc(c->leb_size);
 	ltab = vmalloc(sizeof(struct ubifs_lpt_lprops) * c->lpt_lebs);
-	lsave = kmalloc(sizeof(int) * c->lsave_cnt, GFP_KERNEL);
 	if (!pnode || !nnode || !buf || !ltab || !lsave) {
 		err = -ENOMEM;
 		goto out;

-- 
Hamish Moffatt VK3SB <hamish@debian.org> <hamish@cloud.net.au>

             reply	other threads:[~2008-05-02  5:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-02  5:22 Hamish Moffatt [this message]
2008-05-05  7:28 ` [RFC][PATCH] making ubifs compile with gcc-3.4 Artem Bityutskiy

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=20080502052211.GB6654@cloud.net.au \
    --to=hamish@cloud.net.au \
    --cc=linux-mtd@lists.infradead.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