Skip to contentSkip to conversation

ppc: Export empty_zero_page

PATCH In review Theodore Ts'o 4 participants 8 messages Mar 12, 2008 – Mar 25, 2008 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc: Export empty_zero_page

Hi,

Stephen Rothwell discovered this issue in the linux-next tree:

Quoted 10 lines

Today's powerpc allmodconfig build of linux-next failed with:

ERROR: "empty_zero_page" [fs/ext4/ext4dev.ko] undefined!

This is because commit dde5f2130096f8469eb1aa1ad250cd2a39fee3f5 ("ext4:
ENOSPC error handling for writing to an uninitialized extent") uses ZERO_PAGE() which on powerpc uses empty_zero_page which is not EXPORT_SYMBOLed on powerpc. I have reverted that commit and a later one (1ae53f35fea49a9013353078e019469551d2ad74 "ext4: zero out small extents when writing to prealloc area.") which depended on it.

Any chance you could get this pushed to Linus ASAP? It would be nice if this could get pushed before the merge window, since it could be argued that rationalizing whether or not empty_zero_page is exported is a bug fix, and anyway this is pretty much a zero-risk patch. Thanks!!

- Ted

Quoted 1 line

From c3638c5a50de0d360210205625df2ab49508f6d3 Mon Sep 17 00:00:00 2001

From: Theodore Ts'o <[email protected]>
Date: Tue, 11 Mar 2008 22:37:27 -0400
Subject: [PATCH] ppc: Export empty_zero_page

The empty_zero_page symbol is exported by most other architectures (s390, ia64, x86, um), and an upcoming ext4 patch needs it because ZERO_PAGE() references empty_zero_page, and we need it to zero out an unitialized extents in ext4 files.

---
 arch/ppc/kernel/ppc_ksyms.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/ppc/kernel/ppc_ksyms.c +1 -0
index c353502..418203e 100644
@@ -60,6 +60,7 @@ long long __ashrdi3(long long, int);
 long long __ashldi3(long long, int);
 long long __lshrdi3(long long, int);
 
+EXPORT_SYMBOL(empty_zero_page);
 EXPORT_SYMBOL(clear_pages);
 EXPORT_SYMBOL(clear_user_page);
 EXPORT_SYMBOL(transfer_to_handler);
Signature · 1 line
1.5.4.1.144.gdfee-dirty
#1 lore raw
Quoted 28 lines · Theodore Ts'o

Hi,

Stephen Rothwell discovered this issue in the linux-next tree:

Quoted 10 lines

Today's powerpc allmodconfig build of linux-next failed with:

ERROR: "empty_zero_page" [fs/ext4/ext4dev.ko] undefined!

This is because commit dde5f2130096f8469eb1aa1ad250cd2a39fee3f5 ("ext4:
ENOSPC error handling for writing to an uninitialized extent") uses ZERO_PAGE() which on powerpc uses empty_zero_page which is not EXPORT_SYMBOLed on powerpc. I have reverted that commit and a later one (1ae53f35fea49a9013353078e019469551d2ad74 "ext4: zero out small extents when writing to prealloc area.") which depended on it.

Any chance you could get this pushed to Linus ASAP? It would be nice if this could get pushed before the merge window, since it could be argued that rationalizing whether or not empty_zero_page is exported is a bug fix, and anyway this is pretty much a zero-risk patch. Thanks!!

- Ted

Quoted 1 line

From c3638c5a50de0d360210205625df2ab49508f6d3 Mon Sep 17 00:00:00 2001

From: Theodore Ts'o <[email protected]>
Date: Tue, 11 Mar 2008 22:37:27 -0400
Subject: [PATCH] ppc: Export empty_zero_page

Quoted 8 lines

The empty_zero_page symbol is exported by most other architectures (s390, ia64, x86, um), and an upcoming ext4 patch needs it because ZERO_PAGE() references empty_zero_page, and we need it to zero out an unitialized extents in ext4 files.

---
 arch/ppc/kernel/ppc_ksyms.c |    1 +

I suspect you meant arch/*powerpc* arch ppc, wont fix the problem ;P

Yours Tony

linux.conf.au http://www.marchsouth.org/
Jan 19 - 24 2009 The Australian Linux Technical Conference!

#2 lore raw
Quoted 3 lines · Tony Breeds

I suspect you meant arch/*powerpc* arch ppc, wont fix the problem ;P

Um, right. I didn't know about this:

Quoted 7 lines

Why: The arch/powerpc tree is the merged architecture for ppc32 and ppc64
platforms. Currently there are efforts underway to port the remaining arch/ppc platforms to the merged tree. New submissions to the arch/ppc tree have been frozen with the 2.6.22 kernel release and that tree will remain in bug-fix only mode until its scheduled removal. Platforms that are not ported by June 2008 will be removed due to the lack of an interested maintainer.

Oops, sorry. So should I not bother with a patch to arch/ppc at all? I guess it's somewhat likely that whatever is left in arch/ppc is not likely to need to support ext4?

Back with a real patch in just a bit. :-)

- Ted

#3 lore raw

Once again, this time with feeling....

- Ted

Quoted 1 line

From c91cfaabc17f8a53807a2f31f067a732e34a1550 Mon Sep 17 00:00:00 2001

From: Theodore Ts'o <[email protected]>
Date: Wed, 12 Mar 2008 11:50:39 -0400
Subject: [PATCH] [PATCH] powerpc: Export empty_zero_page

The empty_zero_page symbol is exported by most other architectures (s390, ia64, x86, um), and an upcoming ext4 patch needs it because ZERO_PAGE() references empty_zero_page, and we need it to zero out an unitialized extents in ext4 files.

---
 arch/powerpc/kernel/ppc_ksyms.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/powerpc/kernel/ppc_ksyms.c +1 -0
index aa9ff35..885a723 100644
@@ -58,6 +58,7 @@ extern void program_check_exception(struct pt_regs *regs);
 extern void single_step_exception(struct pt_regs *regs);
 extern int sys_sigreturn(struct pt_regs *regs);
 
+EXPORT_SYMBOL(empty_zero_page);
 EXPORT_SYMBOL(clear_pages);
 EXPORT_SYMBOL(copy_page);
 EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
Signature · 1 line
1.5.4.1.144.gdfee-dirty
#7 lore raw
In reply to Theodore Ts'o
Quoted 13 lines · Theodore Ts'o

Stephen Rothwell discovered this issue in the linux-next tree:

Quoted 10 lines

Today's powerpc allmodconfig build of linux-next failed with:

ERROR: "empty_zero_page" [fs/ext4/ext4dev.ko] undefined!

This is because commit dde5f2130096f8469eb1aa1ad250cd2a39fee3f5 ("ext4:
ENOSPC error handling for writing to an uninitialized extent") uses ZERO_PAGE() which on powerpc uses empty_zero_page which is not EXPORT_SYMBOLed on powerpc. I have reverted that commit and a later one (1ae53f35fea49a9013353078e019469551d2ad74 "ext4: zero out small extents when writing to prealloc area.") which depended on it.

Quoted 4 lines

Any chance you could get this pushed to Linus ASAP? It would be nice if this could get pushed before the merge window, since it could be argued that rationalizing whether or not empty_zero_page is exported is a bug fix, and anyway this is pretty much a zero-risk patch. Thanks!!

The real fix is that ext4 shouldn't be using ZERO_PAGE(). Please use the same zeroing helpers all the other filesystems and drivers use.

#4 lore raw
In reply to Theodore Tso

So I screwed this one up. Mea culpa, mea culpa, mea maxima culpa....

I assume Stephen's already sent this to patch to you guys (I picked it up from the linux-next git tree), but just in case he didn't....

- Ted

Quoted 1 line

From 7919d4874fe991abd0b686ac1f68131c818cdb36 Mon Sep 17 00:00:00 2001

From: Stephen Rothwell <[email protected]>
Date: Thu, 13 Mar 2008 16:16:10 +1100
Subject: [PATCH] really export empty_zero_page

It was being protected by CONFIG_PPC32.

---
 arch/powerpc/kernel/ppc_ksyms.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/kernel/ppc_ksyms.c +1 -1
index 65d14e6..1e89eb5 100644
@@ -57,7 +57,6 @@ extern void program_check_exception(struct pt_regs *regs);
 extern void single_step_exception(struct pt_regs *regs);
 extern int sys_sigreturn(struct pt_regs *regs);
 
-EXPORT_SYMBOL(empty_zero_page);
 EXPORT_SYMBOL(clear_pages);
 EXPORT_SYMBOL(copy_page);
 EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
@@ -191,3 +190,4 @@ EXPORT_SYMBOL(intercept_table);
 EXPORT_SYMBOL(__mtdcr);
 EXPORT_SYMBOL(__mfdcr);
 #endif
+EXPORT_SYMBOL(empty_zero_page);
Signature · 1 line
1.5.4.1.144.gdfee-dirty
#5 lore raw

Hi Ted,

Quoted 5 lines · On Tue, 25 Mar 2008 09:54:54 -0400 Theodore Tso <[email protected]> wrote:

So I screwed this one up. Mea culpa, mea culpa, mea maxima culpa....

I assume Stephen's already sent this to patch to you guys (I picked it up from the linux-next git tree), but just in case he didn't....

Yeah, I already sent it and paulus is probably going to put it in his 2.6.26 tree.

However, have you made any progress on Christoph's suggestion:

"The real fix is that ext4 shouldn't be using ZERO_PAGE(). Please use the same zeroing helpers all the other filesystems and drivers use."

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#6 lore raw
Quoted 4 lines · Stephen Rothwell

However, have you made any progress on Christoph's suggestion:

"The real fix is that ext4 shouldn't be using ZERO_PAGE(). Please use the same zeroing helpers all the other filesystems and drivers use."

When Aneesh asked for clarification about Christoph's suggestion, he got the following response (see attached).

- Ted

Quoted 12 lines · Aneesh Kumar K.V

Hi Christoph,

I have changes pending for ext4 which uses ZERO_PAGE(0) to zero out file system blocks.

http://repo.or.cz/w/ext4-patch-queue.git?a=blob;f=ext4-fallocate-full-fs-ENOSPC-handling.patch;h=e14ec2a53f008c3f4b80544a897165de4bb5d360;hb=HEAD

The changes are needed to make sure we allow writing to prealloc space even when there are no space left in the file system to insert new extent details. To use ZERO_PAGE in ext4 i would need patches to export some of the variables. I found that you answered Ted's patch at

Quoted 4 lines

http://ozlabs.org/pipermail/linuxppc-dev/2008-March/052956.html

I have a patch that does the same thing for multiple arch. Can you help me understand what you meant by zeroing helpers ?

Ok, you're actually sending down the page and not copying from it. This is probab;y okay.