2.6.6-mm4: missing symbol __log_start_commit in ext3.o
Hi,
ext3 complains about a missing symbol in 2.6.6.-mm4:
SPLIT include/linux/autoconf.h -> include/config/*
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
CC [M] fs/ext3/balloc.o
LD [M] fs/ext3/ext3.o
Building modules, stage 2.
MODPOST
*** Warning: "__log_start_commit" [fs/ext3/ext3.ko] undefined!
.config attached.
Cheers
Martin
=====
------------------------------------------------------
Martin Knoblauch
email: k n o b i AT knobisoft DOT de www: http://www.knobisoft.de
(Resend due to MTA problems)
Quoted 5 lines · Martin Knoblauch
Hi,
ext3 complains about a missing symbol in 2.6.6.-mm4:
Quoted 8 lines
SPLIT
include/linux/autoconf.h->include/config/*
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
CC [M]fs/ext3/balloc.o
LD [M]fs/ext3/ext3.o
Building modules, stage 2.
MODPOST
*** Warning: "__log_start_commit" [fs/ext3/ext3.ko] undefined!
Ah, we forgot to export that symbol.
Actually that patch is being a bit naughty playing with JBD internals - it should be cast as a JBD entrypoint.
This isn't runtime-tested:
---
25-akpm/fs/ext3/balloc.c | 28 ++-------------------------- 25-akpm/fs/jbd/journal.c | 34 ++++++++++++++++++++++++++++++++++ 25-akpm/include/linux/jbd.h | 1 + 3 files changed, 37 insertions(+), 26 deletions(-)
fs/jbd/journal.c renamed from fs/jbd/journal.c~ext3-retry-allocation-after-transaction-commit-v2-jbd-api +34 -0
@@ -73,6 +73,7 @@ EXPORT_SYMBOL(journal_ack_err);EXPORT_SYMBOL (journal_clear_err);EXPORT_SYMBOL (log_wait_commit);EXPORT_SYMBOL (journal_start_commit); +EXPORT_SYMBOL (journal_force_commit_nested);EXPORT_SYMBOL (journal_wipe);EXPORT_SYMBOL (journal_blocks_per_page);EXPORT_SYMBOL (journal_invalidatepage);
@@ -465,6 +466,39 @@ int log_start_commit(journal_t *journal, }/* +* Force and wait upon a commit if the calling process is not within +* transaction. This is used for forcing out undo-protected data which contains +* bitmaps, when the fs is running out of space. +* +* We can only force the running transaction if we don't have an active handle; +* otherwise, we will deadlock. +* +* Returns true if a transaction was started. +*/ +int journal_force_commit_nested (journal_t *journal) +{ +transaction_t *transaction =NULL ; +tid_t tid; + +spin_lock (&journal->j_state_lock); +if (journal->j_running_transaction && !current->journal_info) { + transaction = journal->j_running_transaction; +__log_start_commit (journal, transaction->t_tid); + }else if (journal->j_committing_transaction) + transaction = journal->j_committing_transaction; + +if (!transaction) { +spin_unlock (&journal->j_state_lock); +return 0 ;/* Nothing to retry */ + } + + tid = transaction->t_tid; +spin_unlock (&journal->j_state_lock); +log_wait_commit (journal, tid); +return 1 ; +} + +/* * Start a commit of the current running transaction (if any). Returns true * if a transaction was started, and fills its tid in at *ptid */
fs/ext3/balloc.c renamed from fs/ext3/balloc.c~ext3-retry-allocation-after-transaction-commit-v2-jbd-api +2 -26
@@ -977,43 +977,19 @@ static int ext3_has_free_blocks(struct e }/* -* Ext3_should_retry_alloc is called when ENOSPC is returned, and if +* ext3_should_retry_alloc() is called when ENOSPC is returned, and if * it is profitable to retry the operation, this function will wait * for the current or commiting transaction to complete, and then * return TRUE. */ int ext3_should_retry_alloc (struct super_block *sb,int *retries) { -transaction_t *transaction =NULL ; -journal_t *journal =EXT3_SB (sb)->s_journal; -tid_t tid; -if (!ext3_has_free_blocks (EXT3_SB (sb)) || (*retries)++ >3 )return 0 ;jbd_debug (1 ,"%s: retrying operation after ENOSPC\n" , sb->s_id); -/* -* We can only force the running transaction if we don't have -* an active handle; otherwise, we will deadlock. -*/ -spin_lock (&journal->j_state_lock); -if (journal->j_running_transaction && !current->journal_info) { - transaction = journal->j_running_transaction; -__log_start_commit (journal, transaction->t_tid); - }else if (journal->j_committing_transaction) - transaction = journal->j_committing_transaction; - -if (!transaction) { -spin_unlock (&journal->j_state_lock); -return 0 ;/* Nothing to retry */ - } - - tid = transaction->t_tid; -spin_unlock (&journal->j_state_lock); -log_wait_commit (journal, tid); - -return 1 ; +return journal_force_commit_nested (EXT3_SB (sb)->s_journal); }/*
include/linux/jbd.h renamed from include/linux/jbd.h~ext3-retry-allocation-after-transaction-commit-v2-jbd-api +1 -0
@@ -1006,6 +1006,7 @@ int __log_space_left(journal_t *); /* Caint log_start_commit (journal_t *journal,tid_t tid);int __log_start_commit (journal_t *journal,tid_t tid);int journal_start_commit (journal_t *journal,tid_t *tid); +int journal_force_commit_nested (journal_t *journal);int log_wait_commit (journal_t *journal,tid_t tid);int log_do_checkpoint (journal_t *journal);
_
Quoted 3 lines · Andrew Morton
25-akpm/fs/ext3/balloc.c | 28 ++-------------------------- 25-akpm/fs/jbd/journal.c | 34 ++++++++++++++++++++++++++++++++++ 25-akpm/include/linux/jbd.h | 1 +
Is it just me or is this patch wrong? It doesn't apply to 2.6.6-mm4.
nbensa@venkman:~/linux-2.6.6-mm4$ patch -Rp1 < ../__log_start_commit.patch patching file fs/jbd/journal.c Hunk #1 FAILED at 73. Hunk #2 FAILED at 465. 2 out of 2 hunks FAILED -- saving rejects to file fs/jbd/journal.c.rej patching file fs/ext3/balloc.c Hunk #1 FAILED at 977. 1 out of 1 hunk FAILED -- saving rejects to file fs/ext3/balloc.c.rej patching file include/linux/jbd.h Hunk #1 FAILED at 1006. 1 out of 1 hunk FAILED -- saving rejects to file include/linux/jbd.h.rej
Quoted 1 line · Norberto Bensa
nbensa@venkman:~/linux-2.6.6-mm4$ patch -Rp1 < ../__log_start_commit.patch
^^^
Wrong -pX
Grrr.... I'm sorry; too late here. I better go to sleep.
Regards,
Norberto
Quoted 5 lines · Martin Knoblauch
Hi,
ext3 complains about a missing symbol in 2.6.6.-mm4:
Quoted 8 lines
SPLIT
include/linux/autoconf.h->include/config/*
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
CC [M]fs/ext3/balloc.o
LD [M]fs/ext3/ext3.o
Building modules, stage 2.
MODPOST
*** Warning: "__log_start_commit" [fs/ext3/ext3.ko] undefined!
Ah, we forgot to export that symbol.
Actually that patch is being a bit naughty playing with JBD internals - it should be cast as a JBD entrypoint.
This isn't runtime-tested:
---
25-akpm/fs/ext3/balloc.c | 28 ++-------------------------- 25-akpm/fs/jbd/journal.c | 34 ++++++++++++++++++++++++++++++++++ 25-akpm/include/linux/jbd.h | 1 + 3 files changed, 37 insertions(+), 26 deletions(-)
fs/jbd/journal.c renamed from fs/jbd/journal.c~ext3-retry-allocation-after-transaction-commit-v2-jbd-api +34 -0
@@ -73,6 +73,7 @@ EXPORT_SYMBOL(journal_ack_err);EXPORT_SYMBOL (journal_clear_err);EXPORT_SYMBOL (log_wait_commit);EXPORT_SYMBOL (journal_start_commit); +EXPORT_SYMBOL (journal_force_commit_nested);EXPORT_SYMBOL (journal_wipe);EXPORT_SYMBOL (journal_blocks_per_page);EXPORT_SYMBOL (journal_invalidatepage);
@@ -465,6 +466,39 @@ int log_start_commit(journal_t *journal, }/* +* Force and wait upon a commit if the calling process is not within +* transaction. This is used for forcing out undo-protected data which contains +* bitmaps, when the fs is running out of space. +* +* We can only force the running transaction if we don't have an active handle; +* otherwise, we will deadlock. +* +* Returns true if a transaction was started. +*/ +int journal_force_commit_nested (journal_t *journal) +{ +transaction_t *transaction =NULL ; +tid_t tid; + +spin_lock (&journal->j_state_lock); +if (journal->j_running_transaction && !current->journal_info) { + transaction = journal->j_running_transaction; +__log_start_commit (journal, transaction->t_tid); + }else if (journal->j_committing_transaction) + transaction = journal->j_committing_transaction; + +if (!transaction) { +spin_unlock (&journal->j_state_lock); +return 0 ;/* Nothing to retry */ + } + + tid = transaction->t_tid; +spin_unlock (&journal->j_state_lock); +log_wait_commit (journal, tid); +return 1 ; +} + +/* * Start a commit of the current running transaction (if any). Returns true * if a transaction was started, and fills its tid in at *ptid */
fs/ext3/balloc.c renamed from fs/ext3/balloc.c~ext3-retry-allocation-after-transaction-commit-v2-jbd-api +2 -26
@@ -977,43 +977,19 @@ static int ext3_has_free_blocks(struct e }/* -* Ext3_should_retry_alloc is called when ENOSPC is returned, and if +* ext3_should_retry_alloc() is called when ENOSPC is returned, and if * it is profitable to retry the operation, this function will wait * for the current or commiting transaction to complete, and then * return TRUE. */ int ext3_should_retry_alloc (struct super_block *sb,int *retries) { -transaction_t *transaction =NULL ; -journal_t *journal =EXT3_SB (sb)->s_journal; -tid_t tid; -if (!ext3_has_free_blocks (EXT3_SB (sb)) || (*retries)++ >3 )return 0 ;jbd_debug (1 ,"%s: retrying operation after ENOSPC\n" , sb->s_id); -/* -* We can only force the running transaction if we don't have -* an active handle; otherwise, we will deadlock. -*/ -spin_lock (&journal->j_state_lock); -if (journal->j_running_transaction && !current->journal_info) { - transaction = journal->j_running_transaction; -__log_start_commit (journal, transaction->t_tid); - }else if (journal->j_committing_transaction) - transaction = journal->j_committing_transaction; - -if (!transaction) { -spin_unlock (&journal->j_state_lock); -return 0 ;/* Nothing to retry */ - } - - tid = transaction->t_tid; -spin_unlock (&journal->j_state_lock); -log_wait_commit (journal, tid); - -return 1 ; +return journal_force_commit_nested (EXT3_SB (sb)->s_journal); }/*
include/linux/jbd.h renamed from include/linux/jbd.h~ext3-retry-allocation-after-transaction-commit-v2-jbd-api +1 -0
@@ -1006,6 +1006,7 @@ int __log_space_left(journal_t *); /* Caint log_start_commit (journal_t *journal,tid_t tid);int __log_start_commit (journal_t *journal,tid_t tid);int journal_start_commit (journal_t *journal,tid_t *tid); +int journal_force_commit_nested (journal_t *journal);int log_wait_commit (journal_t *journal,tid_t tid);int log_do_checkpoint (journal_t *journal);
_
Quoted 5 lines · Andrew Morton
Ah, we forgot to export that symbol.
Actually that patch is being a bit naughty playing with JBD internals - it should be cast as a JBD entrypoint.
Yeah, good point; no point making ext3 and jbd more heavily incestuous with each other.
Quoted 1 line
This isn't runtime-tested:
I've compiled and regression tested the patch, and it seems to work just fine.
- Ted
Quoted 12 lines · Martin Knoblauch
Hi,
ext3 complains about a missing symbol in 2.6.6.-mm4:
SPLIT
include/linux/autoconf.h->include/config/*
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
CC [M]fs/ext3/balloc.o
LD [M]fs/ext3/ext3.o
Building modules, stage 2.
MODPOST
*** Warning: "__log_start_commit" [fs/ext3/ext3.ko] undefined!
Quoted 1 line
.config attached.
Thanks for this report.
@Ted:
Your "Retry allocation after transaction commit" patch broke modular ext3.
Quoted 2 lines
Cheers
Martin
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed