<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/jbd/checkpoint.c, branch linux-3.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.1.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.1.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2011-06-27T22:06:41Z</updated>
<entry>
<title>jbd: Use WRITE_SYNC in journal checkpoint.</title>
<updated>2011-06-27T22:06:41Z</updated>
<author>
<name>Tao Ma</name>
</author>
<published>2011-06-07T03:56:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a212d1a71deea10ba4f6de2aaac0221be34ddb29'/>
<id>urn:sha1:a212d1a71deea10ba4f6de2aaac0221be34ddb29</id>
<content type='text'>
In journal checkpoint, we write the buffer and wait for its finish.
But in cfq, the async queue has a very low priority, and in our test,
if there are too many sync queues and every queue is filled up with
requests, and the process will hang waiting for the log space.

So this patch tries to use WRITE_SYNC in __flush_batch so that the request will
be moved into sync queue and handled by cfq timely. We also use the new plug,
sot that all the WRITE_SYNC requests can be given as a whole when we unplug it.

Reported-by: Robin Dong &lt;sanbai@taobao.com&gt;
Signed-off-by: Tao Ma &lt;boyu.mt@taobao.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>jbd: Fix oops in journal_remove_journal_head()</title>
<updated>2011-06-27T09:44:37Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2011-06-24T21:11:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bb189247f35688a3353545902c56290fb7d7754a'/>
<id>urn:sha1:bb189247f35688a3353545902c56290fb7d7754a</id>
<content type='text'>
journal_remove_journal_head() can oops when trying to access journal_head
returned by bh2jh(). This is caused for example by the following race:

	TASK1					TASK2
  journal_commit_transaction()
    ...
    processing t_forget list
      __journal_refile_buffer(jh);
      if (!jh-&gt;b_transaction) {
        jbd_unlock_bh_state(bh);
					journal_try_to_free_buffers()
					  journal_grab_journal_head(bh)
					  jbd_lock_bh_state(bh)
					  __journal_try_to_free_buffer()
					  journal_put_journal_head(jh)
        journal_remove_journal_head(bh);

journal_put_journal_head() in TASK2 sees that b_jcount == 0 and buffer is not
part of any transaction and thus frees journal_head before TASK1 gets to doing
so. Note that even buffer_head can be released by try_to_free_buffers() after
journal_put_journal_head() which adds even larger opportunity for oops (but I
didn't see this happen in reality).

Fix the problem by making transactions hold their own journal_head reference
(in b_jcount). That way we don't have to remove journal_head explicitely via
journal_remove_journal_head() and instead just remove journal_head when
b_jcount drops to zero. The result of this is that [__]journal_refile_buffer(),
[__]journal_unfile_buffer(), and __journal_remove_checkpoint() can free
journal_head which needs modification of a few callers. Also we have to be
careful because once journal_head is removed, buffer_head might be freed as
well. So we have to get our own buffer_head reference where it matters.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>jbd: Add fixed tracepoints</title>
<updated>2011-06-25T15:29:51Z</updated>
<author>
<name>Lukas Czerner</name>
</author>
<published>2011-05-23T16:33:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=99cb1a318c37bf462c53d43f4dacb7b4896ce0c9'/>
<id>urn:sha1:99cb1a318c37bf462c53d43f4dacb7b4896ce0c9</id>
<content type='text'>
This commit adds fixed tracepoint for jbd. It has been based on fixed
tracepoints for jbd2, however there are missing those for collecting
statistics, since I think that it will require more intrusive patch so I
should have its own commit, if someone decide that it is needed. Also
there are new tracepoints in __journal_drop_transaction() and
journal_update_superblock().

The list of jbd tracepoints:

jbd_checkpoint
jbd_start_commit
jbd_commit_locking
jbd_commit_flushing
jbd_commit_logging
jbd_drop_transaction
jbd_end_commit
jbd_do_submit_data
jbd_cleanup_journal_tail
jbd_update_superblock_end

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>jbd: Convert atomic_inc() to get_bh()</title>
<updated>2010-10-27T23:30:05Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2010-10-16T08:11:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e4d5e3a497e159be7c2dbe4c61cfb185d60cfde2'/>
<id>urn:sha1:e4d5e3a497e159be7c2dbe4c61cfb185d60cfde2</id>
<content type='text'>
Convert atomic_inc(&amp;bh-&gt;b_count) to get_bh(bh) for consistency.

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>remove SWRITE* I/O types</title>
<updated>2010-08-18T05:09:01Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2010-08-11T15:06:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9cb569d601e0b93e01c20a22872270ec663b75f6'/>
<id>urn:sha1:9cb569d601e0b93e01c20a22872270ec663b75f6</id>
<content type='text'>
These flags aren't real I/O types, but tell ll_rw_block to always
lock the buffer instead of giving up on a failed trylock.

Instead add a new write_dirty_buffer helper that implements this semantic
and use it from the existing SWRITE* callers.  Note that the ll_rw_block
code had a bug where it didn't promote WRITE_SYNC_PLUG properly, which
this patch fixes.

In the ufs code clean up the helper that used to call ll_rw_block
to mirror sync_dirty_buffer, which is the function it implements for
compound buffers.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>jbd: Journal block numbers can ever be only 32-bit use unsigned int for them</title>
<updated>2009-09-16T15:44:10Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2009-08-03T17:21:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9c28cbccec66a5ca292c6659bf5a0fe0c8459fa7'/>
<id>urn:sha1:9c28cbccec66a5ca292c6659bf5a0fe0c8459fa7</id>
<content type='text'>
It does not make sense to store block number for journal as unsigned long
since they can be only 32-bit (because of on-disk format limitation). So
change in-memory structures and variables to use unsigned int instead.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>jbd: don't give up looking for space so easily in __log_wait_for_space</title>
<updated>2008-11-07T03:37:59Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2008-11-07T03:37:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e219cca082f52e7dfea41f3be264b7b5eb204227'/>
<id>urn:sha1:e219cca082f52e7dfea41f3be264b7b5eb204227</id>
<content type='text'>
Commit be07c4ed introducd a regression because it assumed that if
there were no transactions ready to be checkpointed, that no progress
could be made on making space available in the journal, and so the
journal should be aborted.  This assumption is false; it could be the
case that simply calling cleanup_journal_tail() will recover the
necessary space, or, for small journals, the currently committing
transaction could be responsible for chewing up the required space in
the log, so we need to wait for the currently committing transaction
to finish before trying to force a checkpoint operation.

This patch fixes the bug reported by Meelis Roos at:
http://bugzilla.kernel.org/show_bug.cgi?id=11937

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: Duane Griffin &lt;duaneg@dghda.com&gt;
Cc: Toshiyuki Okajima &lt;toshi.okajima@jp.fujitsu.com&gt;
</content>
</entry>
<entry>
<title>jbd: abort instead of waiting for nonexistent transactions</title>
<updated>2008-10-23T15:55:02Z</updated>
<author>
<name>Duane Griffin</name>
</author>
<published>2008-10-22T21:15:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=be07c4ed4043ab8c26f222348136141335e47a2f'/>
<id>urn:sha1:be07c4ed4043ab8c26f222348136141335e47a2f</id>
<content type='text'>
The __log_wait_for_space function sits in a loop checkpointing
transactions until there is sufficient space free in the journal.
However, if there are no transactions to be processed (e.g.  because the
free space calculation is wrong due to a corrupted filesystem) it will
never progress.

Check for space being required when no transactions are outstanding and
abort the journal instead of endlessly looping.

This patch fixes the bug reported by Sami Liedes at:
http://bugzilla.kernel.org/show_bug.cgi?id=10976

Signed-off-by: Duane Griffin &lt;duaneg@dghda.com&gt;
Tested-by: Sami Liedes &lt;sliedes@cc.hut.fi&gt;
Cc: &lt;linux-ext4@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>jbd: test BH_Write_EIO to detect errors on metadata buffers</title>
<updated>2008-10-23T15:55:02Z</updated>
<author>
<name>Hidehiro Kawai</name>
</author>
<published>2008-10-22T21:15:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9f818b4ac04f53458d0354950b4f229f54be4dbf'/>
<id>urn:sha1:9f818b4ac04f53458d0354950b4f229f54be4dbf</id>
<content type='text'>
__try_to_free_cp_buf(), __process_buffer(), and __wait_cp_io() test
BH_Uptodate flag to detect write I/O errors on metadata buffers.  But by
commit 95450f5a7e53d5752ce1a0d0b8282e10fe745ae0 "ext3: don't read inode
block if the buffer has a write error"(*), BH_Uptodate flag can be set to
inode buffers with BH_Write_EIO in order to avoid reading old inode data.
So now, we have to test BH_Write_EIO flag of checkpointing inode buffers
instead of BH_Uptodate.  This patch does it.

Signed-off-by: Hidehiro Kawai &lt;hidehiro.kawai.ez@hitachi.com&gt;
Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Acked-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>jbd: fix error handling for checkpoint io</title>
<updated>2008-10-23T15:55:01Z</updated>
<author>
<name>Hidehiro Kawai</name>
</author>
<published>2008-10-22T21:15:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4afe978530702c934dfdb11f54073136818b2119'/>
<id>urn:sha1:4afe978530702c934dfdb11f54073136818b2119</id>
<content type='text'>
When a checkpointing IO fails, current JBD code doesn't check the error
and continue journaling.  This means latest metadata can be lost from both
the journal and filesystem.

This patch leaves the failed metadata blocks in the journal space and
aborts journaling in the case of log_do_checkpoint().  To achieve this, we
need to do:

1. don't remove the failed buffer from the checkpoint list where in
   the case of __try_to_free_cp_buf() because it may be released or
   overwritten by a later transaction
2. log_do_checkpoint() is the last chance, remove the failed buffer
   from the checkpoint list and abort the journal
3. when checkpointing fails, don't update the journal super block to
   prevent the journaled contents from being cleaned.  For safety,
   don't update j_tail and j_tail_sequence either
4. when checkpointing fails, notify this error to the ext3 layer so
   that ext3 don't clear the needs_recovery flag, otherwise the
   journaled contents are ignored and cleaned in the recovery phase
5. if the recovery fails, keep the needs_recovery flag
6. prevent cleanup_journal_tail() from being called between
   __journal_drop_transaction() and journal_abort() (a race issue
   between journal_flush() and __log_wait_for_space()

Signed-off-by: Hidehiro Kawai &lt;hidehiro.kawai.ez@hitachi.com&gt;
Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Cc: &lt;linux-ext4@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
