<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/jbd2, branch v3.2.2</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/jbd2?h=v3.2.2</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/jbd2?h=v3.2.2'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-11-01T23:09:18Z</updated>
<entry>
<title>jbd2: Unify log messages in jbd2 code</title>
<updated>2011-11-01T23:09:18Z</updated>
<author>
<name>Eryu Guan</name>
<email>guaneryu@gmail.com</email>
</author>
<published>2011-11-01T23:09:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f2a44523b20f323e4aef7c16261d34d6f0a4bf06'/>
<id>urn:sha1:f2a44523b20f323e4aef7c16261d34d6f0a4bf06</id>
<content type='text'>
Some jbd2 code prints out kernel messages with "JBD2: " prefix, at the
same time other jbd2 code prints with "JBD: " prefix. Unify the prefix
to "JBD2: ".

Signed-off-by: Eryu Guan &lt;guaneryu@gmail.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd/jbd2: validate sb-&gt;s_first in journal_get_superblock()</title>
<updated>2011-11-01T23:04:59Z</updated>
<author>
<name>Eryu Guan</name>
<email>guaneryu@gmail.com</email>
</author>
<published>2011-11-01T23:04:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8762202dd0d6e46854f786bdb6fb3780a1625efe'/>
<id>urn:sha1:8762202dd0d6e46854f786bdb6fb3780a1625efe</id>
<content type='text'>
I hit a J_ASSERT(blocknr != 0) failure in cleanup_journal_tail() when
mounting a fsfuzzed ext3 image. It turns out that the corrupted ext3
image has s_first = 0 in journal superblock, and the 0 is passed to
journal-&gt;j_head in journal_reset(), then to blocknr in
cleanup_journal_tail(), in the end the J_ASSERT failed.

So validate s_first after reading journal superblock from disk in
journal_get_superblock() to ensure s_first is valid.

The following script could reproduce it:

fstype=ext3
blocksize=1024
img=$fstype.img
offset=0
found=0
magic="c0 3b 39 98"

dd if=/dev/zero of=$img bs=1M count=8
mkfs -t $fstype -b $blocksize -F $img
filesize=`stat -c %s $img`
while [ $offset -lt $filesize ]
do
        if od -j $offset -N 4 -t x1 $img | grep -i "$magic";then
                echo "Found journal: $offset"
                found=1
                break
        fi
        offset=`echo "$offset+$blocksize" | bc`
done

if [ $found -ne 1 ];then
        echo "Magic \"$magic\" not found"
        exit 1
fi

dd if=/dev/zero of=$img seek=$(($offset+23)) conv=notrunc bs=1 count=1

mkdir -p ./mnt
mount -o loop $img ./mnt

Cc: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Eryu Guan &lt;guaneryu@gmail.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd2: fix build when CONFIG_BUG is not enabled</title>
<updated>2011-10-27T08:05:13Z</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@xenotime.net</email>
</author>
<published>2011-10-27T08:05:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=44705754610dbc63503bc7679ff9d9f84978a76f'/>
<id>urn:sha1:44705754610dbc63503bc7679ff9d9f84978a76f</id>
<content type='text'>
Fix build error when CONFIG_BUG is not enabled:

fs/jbd2/transaction.c:1175:3: error: implicit declaration of function '__WARN'

by changing __WARN() to WARN_ON(), as suggested by
Arnaud Lacombe &lt;lacombar@gmail.com&gt;.

Signed-off-by: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Arnaud Lacombe &lt;lacombar@gmail.com&gt;
</content>
</entry>
<entry>
<title>jbd2: use gfp_t instead of int</title>
<updated>2011-09-04T14:20:14Z</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2011-09-04T14:20:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d2159fb7b8bac12684aabdf41d84b56da9f5c062'/>
<id>urn:sha1:d2159fb7b8bac12684aabdf41d84b56da9f5c062</id>
<content type='text'>
This silences some Sparse warnings:
fs/jbd2/transaction.c:135:69: warning: incorrect type in argument 2 (different base types)
fs/jbd2/transaction.c:135:69:    expected restricted gfp_t [usertype] flags
fs/jbd2/transaction.c:135:69:    got int [signed] gfp_mask

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd2: add debugging information to jbd2_journal_dirty_metadata()</title>
<updated>2011-09-04T14:18:14Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2011-09-04T14:18:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9ea7a0df63630ad8197716cd313ea66e28906fc0'/>
<id>urn:sha1:9ea7a0df63630ad8197716cd313ea66e28906fc0</id>
<content type='text'>
Add debugging information in case jbd2_journal_dirty_metadata() is
called with a buffer_head which didn't have
jbd2_journal_get_write_access() called on it, or if the journal_head
has the wrong transaction in it.  In addition, return an error code.
This won't change anything for ocfs2, which will BUG_ON() the non-zero
exit code.

For ext4, the caller of this function is ext4_handle_dirty_metadata(),
and on seeing a non-zero return code, will call __ext4_journal_stop(),
which will print the function and line number of the (buggy) calling
function and abort the journal.  This will allow us to recover instead
of bug halting, which is better from a robustness and reliability
point of view.

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd2: remove jbd2_dev_to_name() from jbd2 tracepoints</title>
<updated>2011-07-11T02:05:08Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2011-07-11T02:05:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4862fd6047ed02e2726667c54d35f538eecc56aa'/>
<id>urn:sha1:4862fd6047ed02e2726667c54d35f538eecc56aa</id>
<content type='text'>
Using function calls in TP_printk causes perf heartburn, so print the
MAJOR/MINOR device numbers instead.

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd2: use WRITE_SYNC in journal checkpoint</title>
<updated>2011-06-27T16:36:29Z</updated>
<author>
<name>Tao Ma</name>
<email>boyu.mt@taobao.com</email>
</author>
<published>2011-06-27T16:36:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d3ad8434aa83ef7c88bc91edcfe012cdcbab9f3e'/>
<id>urn:sha1:d3ad8434aa83ef7c88bc91edcfe012cdcbab9f3e</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, the write request will be delayed for quite a long time and
all the tasks which are waiting for journal space will end with errors like:

INFO: task attr_set:3816 blocked for more than 120 seconds.
"echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
attr_set      D ffff880028393480     0  3816      1 0x00000000
 ffff8802073fbae8 0000000000000086 ffff8802140847c8 ffff8800283934e8
 ffff8802073fb9d8 ffffffff8103e456 ffff8802140847b8 ffff8801ed728080
 ffff8801db4bc080 ffff8801ed728450 ffff880028393480 0000000000000002
Call Trace:
 [&lt;ffffffff8103e456&gt;] ? __dequeue_entity+0x33/0x38
 [&lt;ffffffff8103caad&gt;] ? need_resched+0x23/0x2d
 [&lt;ffffffff814006a6&gt;] ? thread_return+0xa2/0xbc
 [&lt;ffffffffa01f6224&gt;] ? jbd2_journal_dirty_metadata+0x116/0x126 [jbd2]
 [&lt;ffffffffa01f6224&gt;] ? jbd2_journal_dirty_metadata+0x116/0x126 [jbd2]
 [&lt;ffffffff81400d31&gt;] __mutex_lock_common+0x14e/0x1a9
 [&lt;ffffffffa021dbfb&gt;] ? brelse+0x13/0x15 [ext4]
 [&lt;ffffffff81400ddb&gt;] __mutex_lock_slowpath+0x19/0x1b
 [&lt;ffffffff81400b2d&gt;] mutex_lock+0x1b/0x32
 [&lt;ffffffffa01f927b&gt;] __jbd2_journal_insert_checkpoint+0xe3/0x20c [jbd2]
 [&lt;ffffffffa01f547b&gt;] start_this_handle+0x438/0x527 [jbd2]
 [&lt;ffffffff8106f491&gt;] ? autoremove_wake_function+0x0/0x3e
 [&lt;ffffffffa01f560b&gt;] jbd2_journal_start+0xa1/0xcc [jbd2]
 [&lt;ffffffffa02353be&gt;] ext4_journal_start_sb+0x57/0x81 [ext4]
 [&lt;ffffffffa024a314&gt;] ext4_xattr_set+0x6c/0xe3 [ext4]
 [&lt;ffffffffa024aaff&gt;] ext4_xattr_user_set+0x42/0x4b [ext4]
 [&lt;ffffffff81145adb&gt;] generic_setxattr+0x6b/0x76
 [&lt;ffffffff81146ac0&gt;] __vfs_setxattr_noperm+0x47/0xc0
 [&lt;ffffffff81146bb8&gt;] vfs_setxattr+0x7f/0x9a
 [&lt;ffffffff81146c88&gt;] setxattr+0xb5/0xe8
 [&lt;ffffffff81137467&gt;] ? do_filp_open+0x571/0xa6e
 [&lt;ffffffff81146d26&gt;] sys_fsetxattr+0x6b/0x91
 [&lt;ffffffff81002d32&gt;] system_call_fastpath+0x16/0x1b

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.

Signed-off-by: Tao Ma &lt;boyu.mt@taobao.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
Reported-by: Robin Dong &lt;sanbai@taobao.com&gt;
</content>
</entry>
<entry>
<title>jbd2: Fix oops in jbd2_journal_remove_journal_head()</title>
<updated>2011-06-13T19:38:22Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2011-06-13T19:38:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=de1b794130b130e77ffa975bb58cb843744f9ae5'/>
<id>urn:sha1:de1b794130b130e77ffa975bb58cb843744f9ae5</id>
<content type='text'>
jbd2_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
  jbd2_journal_commit_transaction()
    ...
    processing t_forget list
      __jbd2_journal_refile_buffer(jh);
      if (!jh-&gt;b_transaction) {
        jbd_unlock_bh_state(bh);
					jbd2_journal_try_to_free_buffers()
					  jbd2_journal_grab_journal_head(bh)
					  jbd_lock_bh_state(bh)
					  __journal_try_to_free_buffer()
					  jbd2_journal_put_journal_head(jh)
        jbd2_journal_remove_journal_head(bh);

jbd2_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
jbd2_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 jbd2_journal_remove_journal_head() and instead just
remove journal_head when b_jcount drops to zero. The result of this is
that [__]jbd2_journal_refile_buffer(),
[__]jbd2_journal_unfile_buffer(), and
__jdb2_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;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd2: Remove obsolete parameters in the comments for some jbd2 functions</title>
<updated>2011-06-13T02:44:10Z</updated>
<author>
<name>Tao Ma</name>
<email>boyu.mt@taobao.com</email>
</author>
<published>2011-06-13T02:44:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1fb74cda1b5e9c6207225fda5ef7504e815ce0e0'/>
<id>urn:sha1:1fb74cda1b5e9c6207225fda5ef7504e815ce0e0</id>
<content type='text'>
credits isn't a parameter for jbd2_journal_get_write_access and
jbd2_journal_get_undo_access. So remove the corresponding comments.

Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Cc: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Signed-off-by: Tao Ma &lt;boyu.mt@taobao.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4</title>
<updated>2011-05-26T16:53:20Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-05-26T16:53:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=35806b4f7c5620b547f183e9d53f7cfaeabb582b'/>
<id>urn:sha1:35806b4f7c5620b547f183e9d53f7cfaeabb582b</id>
<content type='text'>
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (61 commits)
  jbd2: Add MAINTAINERS entry
  jbd2: fix a potential leak of a journal_head on an error path
  ext4: teach ext4_ext_split to calculate extents efficiently
  ext4: Convert ext4 to new truncate calling convention
  ext4: do not normalize block requests from fallocate()
  ext4: enable "punch hole" functionality
  ext4: add "punch hole" flag to ext4_map_blocks()
  ext4: punch out extents
  ext4: add new function ext4_block_zero_page_range()
  ext4: add flag to ext4_has_free_blocks
  ext4: reserve inodes and feature code for 'quota' feature
  ext4: add support for multiple mount protection
  ext4: ensure f_bfree returned by ext4_statfs() is non-negative
  ext4: protect bb_first_free in ext4_trim_all_free() with group lock
  ext4: only load buddy bitmap in ext4_trim_fs() when it is needed
  jbd2: Fix comment to match the code in jbd2__journal_start()
  ext4: fix waiting and sending of a barrier in ext4_sync_file()
  jbd2: Add function jbd2_trans_will_send_data_barrier()
  jbd2: fix sending of data flush on journal commit
  ext4: fix ext4_ext_fiemap_cb() to handle blocks before request range correctly
  ...
</content>
</entry>
</feed>
