From: Chris Mason <mason@suse.com>
To: Jens Benecke <jens-unibw@spamfreemail.de>
Cc: reiserfs-list@namesys.com
Subject: Re: Strange errors with 2.4.22 patches (from Chris) and bonnie++
Date: Thu, 04 Dec 2003 11:33:17 -0500 [thread overview]
Message-ID: <1070555596.27597.184.camel@tiny.suse.com> (raw)
In-Reply-To: <1070555322.27612.181.camel@tiny.suse.com>
[-- Attachment #1: Type: text/plain, Size: 821 bytes --]
On Thu, 2003-12-04 at 11:28, Chris Mason wrote:
> On Thu, 2003-12-04 at 07:44, Jens Benecke wrote:
> > Chris Mason wrote:
> >
> > >> so... the worst-case impact on this bug is that reiserfs will report
> > >> "disk full" when you still have some space available. Right? No data
> > >> loss, corruption, or similar Bad Things(tm)?
> > >>
> > > Correct. I'll have a fix available today along with a remerge of data
> > > logging and quota against 2.4.23.
>
> The -ENOSPC fix is attached, 2.6 should have the same bug (it was
> introduced with the new allocator) so I'm porting the fix there.
> Basically after a data block allocation fails, we need to trigger and
> wait on a commit so we can reclaim any blocks freed in transactions that
> have not yet been comitted.
Hmpf, this time it is really attached.
-chris
[-- Attachment #2: 01-reiserfs-free-blocks --]
[-- Type: text/plain, Size: 2534 bytes --]
%patch
trigger a commit when a data block allocation fails, this will
allow us to reclaim any blocks freed in uncommitted transactsions
diff -Nru a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
--- a/fs/reiserfs/inode.c Wed Dec 3 18:13:01 2003
+++ b/fs/reiserfs/inode.c Wed Dec 3 18:13:01 2003
@@ -628,7 +628,11 @@
/* restart the transaction to give the journal a chance to free
** some blocks. releases the path, so we have to go back to
** research if we succeed on the second try
+ **
+ ** the journal won't free the blocks if we don't force a commit
+ ** and wait for it
*/
+ SB_JOURNAL(inode->i_sb)->j_next_async_flush = 1;
restart_transaction(&th, inode, &path) ;
repeat = _allocate_block(&th, block, inode, &allocated_block_nr, NULL, create);
diff -Nru a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
--- a/fs/reiserfs/journal.c Wed Dec 3 18:13:01 2003
+++ b/fs/reiserfs/journal.c Wed Dec 3 18:13:01 2003
@@ -2996,7 +2996,6 @@
int jindex ;
int orig_jindex ;
int flush = flags & FLUSH_ALL ;
- int commit_now = flags & COMMIT_NOW ;
int wait_on_commit = flags & WAIT ;
struct reiserfs_super_block *rs ;
@@ -3010,8 +3009,8 @@
flush = 1 ;
}
if (SB_JOURNAL(p_s_sb)->j_next_async_flush) {
- flags |= COMMIT_NOW ;
- commit_now = 1 ;
+ flags |= COMMIT_NOW | WAIT;
+ wait_on_commit = 1;
}
/* check_journal_end locks the journal, and unlocks if it does not return 1
@@ -3025,9 +3024,6 @@
if (SB_JOURNAL(p_s_sb)->j_next_full_flush) {
flush = 1 ;
}
- if (SB_JOURNAL(p_s_sb)->j_next_async_flush) {
- commit_now = 1 ;
- }
/*
** j must wait means we have to flush the log blocks, and the real blocks for
** this transaction
@@ -3191,15 +3187,12 @@
/* honor the flush and async wishes from the caller */
if (flush) {
-
flush_commit_list(p_s_sb, SB_JOURNAL_LIST(p_s_sb) + orig_jindex, 1) ;
flush_journal_list(p_s_sb, SB_JOURNAL_LIST(p_s_sb) + orig_jindex , 1) ;
- } else if (commit_now) {
- if (wait_on_commit) {
- flush_commit_list(p_s_sb, SB_JOURNAL_LIST(p_s_sb) + orig_jindex, 1) ;
- } else {
- commit_flush_async(p_s_sb, orig_jindex) ;
- }
+ } else if (wait_on_commit) {
+ flush_commit_list(p_s_sb, SB_JOURNAL_LIST(p_s_sb) + orig_jindex, 1) ;
+ } else {
+ commit_flush_async(p_s_sb, orig_jindex) ;
}
/* reset journal values for the next transaction */
@@ -3263,6 +3256,3 @@
wake_up(&(SB_JOURNAL(p_s_sb)->j_join_wait)) ;
return 0 ;
}
-
-
-
prev parent reply other threads:[~2003-12-04 16:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bq8f7u$ufn$1@sea.gmane.org>
2003-11-28 16:46 ` Strange errors with 2.4.22 patches (from Chris) and bonnie++ Hans Reiser
2003-11-29 19:27 ` Christian Mayrhuber
2003-12-01 13:30 ` Chris Mason
2003-12-01 16:00 ` Christian Mayrhuber
2003-12-01 17:21 ` slow stat() ? David Bernick
2003-12-01 17:30 ` Chris Mason
2003-12-01 7:47 ` Hans Reiser
2003-12-11 4:44 ` update on " David Bernick
2003-12-01 17:43 ` David Bernick
2003-12-01 17:57 ` Chris Mason
2003-12-02 11:57 ` David Bernick
2003-12-01 8:02 ` Strange errors with 2.4.22 patches (from Chris) and bonnie++ Jens Benecke
2003-12-01 13:49 ` Chris Mason
2003-12-02 8:35 ` Jens Benecke
2003-12-03 19:13 ` Chris Mason
2003-12-04 12:44 ` Jens Benecke
2003-12-04 16:28 ` Chris Mason
2003-12-04 16:33 ` Chris Mason [this message]
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=1070555596.27597.184.camel@tiny.suse.com \
--to=mason@suse.com \
--cc=jens-unibw@spamfreemail.de \
--cc=reiserfs-list@namesys.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.