<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/jbd2/transaction.c, branch linux-3.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-03-07T06:06:09Z</updated>
<entry>
<title>jbd2: fix use after free in jbd2_journal_start_reserved()</title>
<updated>2014-03-07T06:06:09Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2014-02-18T01:33:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d3142a00e65cb3664db42d080ba1e5468fae21a8'/>
<id>urn:sha1:d3142a00e65cb3664db42d080ba1e5468fae21a8</id>
<content type='text'>
commit 92e3b40537707001d17bbad800d150ab04e53bf4 upstream.

If start_this_handle() fails then it leads to a use after free of
"handle".

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>jbd2: rename obsoleted msg JBD-&gt;JBD2</title>
<updated>2013-12-09T02:14:59Z</updated>
<author>
<name>Dmitry Monakhov</name>
</author>
<published>2013-12-09T02:14:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a67c848a8b9aa9e471f9eaadd2cb29cc527462cf'/>
<id>urn:sha1:a67c848a8b9aa9e471f9eaadd2cb29cc527462cf</id>
<content type='text'>
Rename performed via: perl -pi -e 's/JBD:/JBD2:/g' fs/jbd2/*.c

Signed-off-by: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Carlos Maiolino &lt;cmaiolino@redhat.com&gt;
</content>
</entry>
<entry>
<title>jbd2: revise KERN_EMERG error messages</title>
<updated>2013-12-09T02:13:59Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2013-12-09T02:13:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=75685071cd5b26d64fd2577330387aeab019ac97'/>
<id>urn:sha1:75685071cd5b26d64fd2577330387aeab019ac97</id>
<content type='text'>
Some of KERN_EMERG printk messages do not really deserve this log
level and the one in log_wait_commit() is even rather useless (the
journal has been previously aborted and *that* is where we should have
been complaining). So make some messages just KERN_ERR and remove the
useless message.

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: don't BUG but return ENOSPC if a handle runs out of space</title>
<updated>2013-12-09T02:12:59Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2013-12-09T02:12:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f6c07cad081ba222d63623d913aafba5586c1d2c'/>
<id>urn:sha1:f6c07cad081ba222d63623d913aafba5586c1d2c</id>
<content type='text'>
If a handle runs out of space, we currently stop the kernel with a BUG
in jbd2_journal_dirty_metadata().  This makes it hard to figure out
what might be going on.  So return an error of ENOSPC, so we can let
the file system layer figure out what is going on, to make it more
likely we can get useful debugging information).  This should make it
easier to debug problems such as the one which was reported by:

    https://bugzilla.kernel.org/show_bug.cgi?id=44731

The only two callers of this function are ext4_handle_dirty_metadata()
and ocfs2_journal_dirty().  The ocfs2 function will trigger a
BUG_ON(), which means there will be no change in behavior.  The ext4
function will call ext4_error_inode() which will print the useful
debugging information and then handle the situation using ext4's error
handling mechanisms (i.e., which might mean halting the kernel or
remounting the file system read-only).

Also, since both file systems already call WARN_ON(), drop the WARN_ON
from jbd2_journal_dirty_metadata() to avoid two stack traces from
being displayed.

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: ocfs2-devel@oss.oracle.com
Acked-by: Joel Becker &lt;jlbec@evilplan.org&gt;
</content>
</entry>
<entry>
<title>jbd2: invalidate handle if jbd2_journal_restart() fails</title>
<updated>2013-07-01T12:12:41Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2013-07-01T12:12:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=41a5b913197c3a25fddef1735dc9b3d1fdc57428'/>
<id>urn:sha1:41a5b913197c3a25fddef1735dc9b3d1fdc57428</id>
<content type='text'>
If jbd2_journal_restart() fails the handle will have been disconnected
from the current transaction.  In this situation, the handle must not
be used for for any jbd2 function other than jbd2_journal_stop().
Enforce this with by treating a handle which has a NULL transaction
pointer as an aborted handle, and issue a kernel warning if
jbd2_journal_extent(), jbd2_journal_get_write_access(),
jbd2_journal_dirty_metadata(), etc. is called with an invalid handle.

This commit also fixes a bug where jbd2_journal_stop() would trip over
a kernel jbd2 assertion check when trying to free an invalid handle.

Also move the responsibility of setting current-&gt;journal_info to
start_this_handle(), simplifying the three users of this function.

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reported-by: Younger Liu &lt;younger.liu@huawei.com&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>jbd2: fix theoretical race in jbd2__journal_restart</title>
<updated>2013-07-01T12:12:40Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2013-07-01T12:12:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=39c04153fda8c32e85b51c96eb5511a326ad7609'/>
<id>urn:sha1:39c04153fda8c32e85b51c96eb5511a326ad7609</id>
<content type='text'>
Once we decrement transaction-&gt;t_updates, if this is the last handle
holding the transaction from closing, and once we release the
t_handle_lock spinlock, it's possible for the transaction to commit
and be released.  In practice with normal kernels, this probably won't
happen, since the commit happens in a separate kernel thread and it's
unlikely this could all happen within the space of a few CPU cycles.

On the other hand, with a real-time kernel, this could potentially
happen, so save the tid found in transaction-&gt;t_tid before we release
t_handle_lock.  It would require an insane configuration, such as one
where the jbd2 thread was set to a very high real-time priority,
perhaps because a high priority real-time thread is trying to read or
write to a file system.  But some people who use real-time kernels
have been known to do insane things, including controlling
laser-wielding industrial robots.  :-)

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org

</content>
</entry>
<entry>
<title>jbd2: optimize jbd2_journal_force_commit</title>
<updated>2013-06-13T02:24:07Z</updated>
<author>
<name>Dmitry Monakhov</name>
</author>
<published>2013-06-13T02:24:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9ff864462477206bc23b405a6ae506e92fb6dc9c'/>
<id>urn:sha1:9ff864462477206bc23b405a6ae506e92fb6dc9c</id>
<content type='text'>
Current implementation of jbd2_journal_force_commit() is suboptimal because
result in empty and useless commits. But callers just want to force and wait
any unfinished commits. We already have jbd2_journal_force_commit_nested()
which does exactly what we want, except we are guaranteed that we do not hold
journal transaction open.

Signed-off-by: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd2: transaction reservation support</title>
<updated>2013-06-04T16:35:11Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2013-06-04T16:35:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8f7d89f36829b9061a14f9040cda1372f264c4fe'/>
<id>urn:sha1:8f7d89f36829b9061a14f9040cda1372f264c4fe</id>
<content type='text'>
In some cases we cannot start a transaction because of locking
constraints and passing started transaction into those places is not
handy either because we could block transaction commit for too long.
Transaction reservation is designed to solve these issues.  It
reserves a handle with given number of credits in the journal and the
handle can be later attached to the running transaction without
blocking on commit or checkpointing.  Reserved handles do not block
transaction commit in any way, they only reduce maximum size of the
running transaction (because we have to always be prepared to
accomodate request for attaching reserved handle).

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: fix race in t_outstanding_credits update in jbd2_journal_extend()</title>
<updated>2013-06-04T16:22:15Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2013-06-04T16:22:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe1e8db598b259eafdffbe3dd5fe849cd2ad97d5'/>
<id>urn:sha1:fe1e8db598b259eafdffbe3dd5fe849cd2ad97d5</id>
<content type='text'>
jbd2_journal_extend() first checked whether transaction can accept
extending handle with more credits and then added credits to
t_outstanding_credits.  This can race with start_this_handle() adding
another handle to a transaction and thus overbooking a transaction.
Make jbd2_journal_extend() use atomic_add_return() to close the race.

Reviewed-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
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: cleanup needed free block estimates when starting a transaction</title>
<updated>2013-06-04T16:12:57Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2013-06-04T16:12:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=76c39904561004ac8675f858a290129e439d5168'/>
<id>urn:sha1:76c39904561004ac8675f858a290129e439d5168</id>
<content type='text'>
__jbd2_log_space_left() and jbd_space_needed() were kind of odd.
jbd_space_needed() accounted also credits needed for currently
committing transaction while it didn't account for credits needed for
control blocks.  __jbd2_log_space_left() then accounted for control
blocks as a fraction of free space.  Since results of these two
functions are always only compared against each other, this works
correct but is somewhat strange.  Move the estimates so that
jbd_space_needed() returns number of blocks needed for a transaction
including control blocks and __jbd2_log_space_left() returns free
space in the journal (with the committing transaction already
subtracted).  Rename functions to jbd2_log_space_left() and
jbd2_space_needed() while we are changing them.

Reviewed-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
</feed>
