<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/jbd/journal.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-12-21T20:58:31Z</updated>
<entry>
<title>jbd/jbd2: validate sb-&gt;s_first in journal_get_superblock()</title>
<updated>2011-12-21T20:58:31Z</updated>
<author>
<name>Eryu Guan</name>
</author>
<published>2011-11-01T23:04:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d02ab857b278eb3a232daf85f78af0252044a728'/>
<id>urn:sha1:d02ab857b278eb3a232daf85f78af0252044a728</id>
<content type='text'>
commit 8762202dd0d6e46854f786bdb6fb3780a1625efe upstream.

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;
Cc: Moritz Mühlenhoff &lt;jmm@inutil.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&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: fix fsync() tid wraparound bug</title>
<updated>2011-05-17T11:47:41Z</updated>
<author>
<name>Ted Ts'o</name>
</author>
<published>2011-04-30T17:17:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9b01934d56a96d9f4ae2d6204d4ea78a36f5f36'/>
<id>urn:sha1:d9b01934d56a96d9f4ae2d6204d4ea78a36f5f36</id>
<content type='text'>
If an application program does not make any changes to the indirect
blocks or extent tree, i_datasync_tid will not get updated.  If there
are enough commits (i.e., 2**31) such that tid_geq()'s calculations
wrap, and there isn't a currently active transaction at the time of
the fdatasync() call, this can end up triggering a BUG_ON in
fs/jbd/commit.c:

	J_ASSERT(journal-&gt;j_running_transaction != NULL);

It's pretty rare that this can happen, since it requires the use of
fdatasync() plus *very* frequent and excessive use of fsync().  But
with the right workload, it can.

We fix this by replacing the use of tid_geq() with an equality test,
since there's only one valid transaction id that is valid for us to
start: namely, the currently running transaction (if it exists).

CC: stable@kernel.org
Reported-by: Martin_Zielinski@McAfee.com
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>Fix common misspellings</title>
<updated>2011-03-31T14:26:23Z</updated>
<author>
<name>Lucas De Marchi</name>
</author>
<published>2011-03-31T01:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=25985edcedea6396277003854657b5f3cb31a628'/>
<id>urn:sha1:25985edcedea6396277003854657b5f3cb31a628</id>
<content type='text'>
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
</content>
</entry>
<entry>
<title>jbd: Remove one to many n's in a word.</title>
<updated>2011-02-28T20:55:58Z</updated>
<author>
<name>Justin P. Mattock</name>
</author>
<published>2011-02-27T04:34:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3c26bdb42320f9f39d30c6f115476bbb66b74dc5'/>
<id>urn:sha1:3c26bdb42320f9f39d30c6f115476bbb66b74dc5</id>
<content type='text'>
The Patch below removes one to many "n's" in a word..

Signed-off-by: Justin P. Mattock &lt;justinmattock@gmail.com&gt;
CC: Andrew Morton &lt;akpm@linux-foundation.org&gt;
CC: linux-ext4@vger.kernel.org
Acked-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>jbd/2: fixed typos</title>
<updated>2010-10-27T23:30:05Z</updated>
<author>
<name>Andrea Gelmini</name>
</author>
<published>2010-10-16T13:19:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bcf3d0bcff9c2ab5794d9a2c5f0ebc9ce63cc63f'/>
<id>urn:sha1:bcf3d0bcff9c2ab5794d9a2c5f0ebc9ce63cc63f</id>
<content type='text'>
"wakup"

Signed-off-by: Andrea Gelmini &lt;andrea.gelmini@gelma.net&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>jbd: Check return value of __getblk()</title>
<updated>2010-10-27T23:30:04Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2010-10-13T08:17:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2a0e33889b3f5e3c270dd1b746f4c0a75efa4790'/>
<id>urn:sha1:2a0e33889b3f5e3c270dd1b746f4c0a75efa4790</id>
<content type='text'>
Fail journal creation if __getblk() returns NULL.  unlikely() is
added because it is called in a loop and we've been OK without
the check until now.

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>ext3/jbd: Avoid WARN() messages when failing to write the superblock</title>
<updated>2010-10-27T23:30:02Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2010-10-04T19:35:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dff6825e9fde93891e60751e01480337a991235e'/>
<id>urn:sha1:dff6825e9fde93891e60751e01480337a991235e</id>
<content type='text'>
This fixes a WARN backtrace in mark_buffer_dirty() that occurs during unmount
when the underlying block device is removed.  This bug has been seen on System
Z when removing all paths from a multipath-backed ext3 mount; on System P when
injecting enough PCI EEH errors to make the SCSI controller go offline; and
similar warnings have been seen (and patched) with ext2/ext4.

The super block update from a previous operation has marked the buffer as in
error, and the flag has to be cleared before doing the update. Similar changes
have been made to ext4 by commit 914258bf2cb22bf4336a1b1d90c551b4b11ca5aa.

Signed-off-by: Darrick J. Wong &lt;djwong@us.ibm.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>jbd: Use printk_ratelimited() in journal_alloc_journal_head()</title>
<updated>2010-10-27T23:30:01Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2010-10-04T10:12:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f81e3d4564a06c5a070337ba527d11865acecb67'/>
<id>urn:sha1:f81e3d4564a06c5a070337ba527d11865acecb67</id>
<content type='text'>
Use printk_ratelimited() instead of doing it manually.

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
</feed>
